diff options
author | Jason Ekstrand <[email protected]> | 2018-09-11 13:06:01 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-09-19 02:00:49 -0500 |
commit | 976046a8d8f9bed8f805d09ac5aebe63b81a71d9 (patch) | |
tree | 4812fa365c551028db289300ee0b0780d4291449 /src/compiler/nir/nir_to_lcssa.c | |
parent | 864c780566b8782c4fc69b4337db768223717bd8 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_to_lcssa.c')
-rw-r--r-- | src/compiler/nir/nir_to_lcssa.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_to_lcssa.c b/src/compiler/nir/nir_to_lcssa.c index 9b3539193ea..0f62fc39400 100644 --- a/src/compiler/nir/nir_to_lcssa.c +++ b/src/compiler/nir/nir_to_lcssa.c @@ -111,6 +111,9 @@ convert_loop_exit_for_ssa(nir_ssa_def *def, void *void_state) if (all_uses_inside_loop) return true; + /* We don't want derefs ending up in phi sources */ + assert(def->parent_instr->type != nir_instr_type_deref); + /* Initialize a phi-instruction */ nir_phi_instr *phi = nir_phi_instr_create(state->shader); nir_ssa_dest_init(&phi->instr, &phi->dest, |