nir: Add some asserts that we don't put derefs in phis

The lcssa and phis_to_regs passes are used by various NIR optimizations
that modify the CFG.  Putting a couple of asserts will help ensure that
we don't accidentally put derefs in phis as part of an optimization
pass.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
Jason Ekstrand
2018-09-11 13:06:01 -05:00
parent 864c780566
commit 976046a8d8
3 changed files with 6 additions and 0 deletions

View File

@@ -901,6 +901,8 @@ nir_lower_phis_to_regs_block(nir_block *block)
nir_foreach_phi_src(src, phi) {
assert(src->src.is_ssa);
/* We don't want derefs ending up in phi sources */
assert(!nir_src_as_deref(src->src));
place_phi_read(shader, reg, src->src.ssa, src->pred);
}