summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-02-25 11:22:10 -0800
committerEric Anholt <[email protected]>2019-02-25 21:25:24 +0000
commit7c1bf075f30527ec9724fe03f0a32d9110bebd0b (patch)
treea3787a864bf7b57f07d701883c4455ba357ac67f
parent5671f38085216caf2cbf221a9fcda08b7571a762 (diff)
nir: Just return when asked to rewrite uses of an SSA def to itself.
The nir_builder swizzling improvement to not emit extra MOVs resulted in nir_lower_tex() trying to rewrite an SSA def to itself, triggering the assert on all texturing in v3d. There's no work to be done in this case, so just stop asserting. Fixes: 743700be1f58 ("nir/builder: Don't emit no-op swizzles") Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r--src/compiler/nir/nir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index 60e30ae1008..d759dfdce21 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1511,7 +1511,8 @@ void
nir_ssa_def_rewrite_uses_after(nir_ssa_def *def, nir_src new_src,
nir_instr *after_me)
{
- assert(!new_src.is_ssa || def != new_src.ssa);
+ if (new_src.is_ssa && def == new_src.ssa)
+ return;
nir_foreach_use_safe(use_src, def) {
assert(use_src->parent_instr != def->parent_instr);