pan/bi: Assume SSA when translating NIR
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 25 Jul 2022 19:13:07 +0000 (15:13 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:23 +0000 (16:03 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

src/panfrost/bifrost/bifrost_compile.c
src/panfrost/bifrost/compiler.h

index 777dbaf..eef3436 100644 (file)
@@ -2297,11 +2297,6 @@ bi_emit_alu(bi_builder *b, nir_alu_instr *instr)
         if (sz == 16 && comps == 1)
                 dst.swizzle = BI_SWIZZLE_H00;
 
-        if (!instr->dest.dest.is_ssa) {
-                for (unsigned i = 0; i < comps; ++i)
-                        assert(instr->dest.write_mask);
-        }
-
         /* First, match against the various moves in NIR. These are
          * special-cased because they can operate on vectors even after
          * lowering ALU to scalar. For Bifrost, bi_alu_src_index assumes the
@@ -4821,8 +4816,6 @@ bi_gather_texcoords(nir_builder *b, nir_instr *instr, void *data)
                 return false;
 
         nir_src src = tex->src[coord_idx].src;
-        assert(src.is_ssa);
-
         nir_ssa_scalar x = nir_ssa_scalar_resolved(src.ssa, 0);
         nir_ssa_scalar y = nir_ssa_scalar_resolved(src.ssa, 1);
 
index e4b5759..97acbb0 100644 (file)
@@ -943,25 +943,19 @@ bi_temp_reg(bi_context *ctx)
 static inline bi_index
 bi_src_index(nir_src *src)
 {
-        if (nir_src_is_const(*src) && nir_src_bit_size(*src) <= 32)
+        if (nir_src_is_const(*src) && nir_src_bit_size(*src) <= 32) {
                 return bi_imm_u32(nir_src_as_uint(*src));
-        else if (src->is_ssa)
+        } else {
+                assert(src->is_ssa);
                 return bi_get_index(src->ssa->index, false, 0);
-        else {
-                assert(!src->reg.indirect);
-                return bi_get_index(src->reg.reg->index, true, 0);
         }
 }
 
 static inline bi_index
 bi_dest_index(nir_dest *dst)
 {
-        if (dst->is_ssa)
-                return bi_get_index(dst->ssa.index, false, 0);
-        else {
-                assert(!dst->reg.indirect);
-                return bi_get_index(dst->reg.reg->index, true, 0);
-        }
+        assert(dst->is_ssa);
+        return bi_get_index(dst->ssa.index, false, 0);
 }
 
 static inline unsigned