<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - nir_instr_as_deref: Assertion `parent && parent->type == nir_instr_type_deref' failed."
href="https://bugs.freedesktop.org/show_bug.cgi?id=109603">109603</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>nir_instr_as_deref: Assertion `parent && parent->type == nir_instr_type_deref' failed.
</td>
</tr>
<tr>
<th>Product</th>
<td>Mesa
</td>
</tr>
<tr>
<th>Version</th>
<td>git
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Component</th>
<td>Drivers/Vulkan/Common
</td>
</tr>
<tr>
<th>Assignee</th>
<td>mesa-dev@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>xavierb@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>airlied@freedesktop.org, chadversary@chromium.org, daniel@fooishbar.org, jason@jlekstrand.net
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=143355" name="attach_143355" title="reduced shader spir-v">attachment 143355</a> <a href="attachment.cgi?id=143355&action=edit" title="reduced shader spir-v">[details]</a></span>
reduced shader spir-v
Hello
The spir-v shader attached triggers an assert
../src/compiler/nir/nir.h:1040: nir_instr_as_deref: Assertion `parent &&
parent->type == nir_instr_type_deref' failed.
(the shader is reduced from a larger shader.)
=> parent->type is "nir_instr_type_phi"
bisected to
commit 639c236e74e99524245c22f1fa0758603f558cf2
Author: Jason Ekstrand <<a href="mailto:jason.ekstrand@intel.com">jason.ekstrand@intel.com</a>>
Date: Thu Oct 25 10:34:34 2018 -0500
spirv: Emit NIR deref instructions on-the-fly
This simplifies our deref handling by emitting the actual NIR deref
instructions on-the-fly instead of of building up a deref chain and then
emitting them at the last moment. In order for this to work with the
parts of the compiler that assume they can chase deref chains, we have
to run nir_rematerialize_derefs_in_use_blocks_impl to put the derefs
back in the right places. Otherwise, in cases such as loop continues
where the SPIR-V blocks are not in the same order as the NIR blocks, we
may end up with a deref chain with a parent that does not dominate it's
child and nir_repair_ssa_impl will insert phis in the deref chain.
Reviewed-by: Alejandro PiƱeiro <<a href="mailto:apinheiro@igalia.com">apinheiro@igalia.com</a>>
Reviewed-by: Caio Marcelo de Oliveira Filho <<a href="mailto:caio.oliveira@intel.com">caio.oliveira@intel.com</a>>
-
backtrace:
#0 0x00007ffff7c74d7f in raise () from /usr/lib/libc.so.6
#1 0x00007ffff7c5f672 in abort () from /usr/lib/libc.so.6
#2 0x00007ffff7c5f548 in __assert_fail_base.cold.0 () from /usr/lib/libc.so.6
#3 0x00007ffff7c6d396 in __assert_fail () from /usr/lib/libc.so.6
#4 0x00007ffff07bf416 in nir_instr_as_deref (parent=0x5555557c7040) at
../src/compiler/nir/nir.h:1039
#5 0x00007ffff07c0fa4 in validate_deref_instr (instr=0x5555557bd8a0,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:436
#6 0x00007ffff07c1b36 in validate_instr (instr=0x5555557bd8a0,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:623
#7 0x00007ffff07c1f21 in validate_block (block=0x5555557bc400,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:714
#8 0x00007ffff07c2a43 in validate_cf_node (node=0x5555557bc400,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:877
#9 0x00007ffff07c27a1 in validate_if (if_stmt=0x5555557bc330,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:831
#10 0x00007ffff07c2a63 in validate_cf_node (node=0x5555557bc330,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:881
#11 0x00007ffff07c2998 in validate_loop (loop=0x5555557b6ae0,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:863
#12 0x00007ffff07c2a83 in validate_cf_node (node=0x5555557b6ae0,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:885
#13 0x00007ffff07c2998 in validate_loop (loop=0x5555557b5240,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:863
#14 0x00007ffff07c2a83 in validate_cf_node (node=0x5555557b5240,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:885
#15 0x00007ffff07c381e in validate_function_impl (impl=0x5555556c75b0,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:1090
#16 0x00007ffff07c393a in validate_function (func=0x5555556ced40,
state=0x7fffffffd8b0)
at ../src/compiler/nir/nir_validate.c:1108
#17 0x00007ffff07c3fb9 in nir_validate_shader (shader=0x5555557a6430,
when=0x7ffff084791d "after spirv_to_nir")
at ../src/compiler/nir/nir_validate.c:1224
#18 0x00007ffff06c726f in radv_shader_compile_to_nir (device=0x55555578f0f0,
module=0x55555578afe0,
entrypoint_name=0x555555574443 "main", stage=MESA_SHADER_COMPUTE,
spec_info=0x0, flags=0)
at ../src/amd/vulkan/radv_shader.c:257
#19 0x00007ffff06bdd11 in radv_create_shaders (pipeline=0x55555578d890,
device=0x55555578f0f0, cache=0x5555557994c0,
key=0x7fffffffe250, pStages=0x7fffffffe220, flags=0) at
../src/amd/vulkan/radv_pipeline.c:2068
#20 0x00007ffff06c24fc in radv_compute_pipeline_create (_device=0x55555578f0f0,
_cache=0x5555557994c0,
pCreateInfo=0x7fffffffe3a0, pAllocator=0x0, pPipeline=0x7fffffffe380) at
../src/amd/vulkan/radv_pipeline.c:3791
#21 0x00007ffff06c267a in radv_CreateComputePipelines (_device=0x55555578f0f0,
pipelineCache=0x5555557994c0, count=1,
pCreateInfos=0x7fffffffe3a0, pAllocator=0x0, pPipelines=0x7fffffffe380) at
../src/amd/vulkan/radv_pipeline.c:3821
#22 0x0000555555565401 in create_compute_pipeline ()</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>