From 976046a8d8f9bed8f805d09ac5aebe63b81a71d9 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Tue, 11 Sep 2018 13:06:01 -0500 Subject: 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 --- src/compiler/nir/nir_from_ssa.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/compiler/nir/nir_from_ssa.c') diff --git a/src/compiler/nir/nir_from_ssa.c b/src/compiler/nir/nir_from_ssa.c index 1aa35509b11..19d4bc33820 100644 --- a/src/compiler/nir/nir_from_ssa.c +++ b/src/compiler/nir/nir_from_ssa.c @@ -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); } -- cgit v1.2.3