ir3: Collapse is_ssa checks
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Tue, 1 Aug 2023 16:26:02 +0000 (12:26 -0400)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Aug 2023 22:40:29 +0000 (22:40 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24432>

src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_nir_analyze_ubo_ranges.c

index bb833a1..0dd7115 100644 (file)
@@ -380,13 +380,8 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
    unsigned dst_sz, wrmask;
    type_t dst_type = type_uint_size(nir_dest_bit_size(alu->dest.dest));
 
-   if (alu->dest.dest.is_ssa) {
-      dst_sz = alu->dest.dest.ssa.num_components;
-      wrmask = (1 << dst_sz) - 1;
-   } else {
-      dst_sz = alu->dest.dest.reg.reg->num_components;
-      wrmask = alu->dest.write_mask;
-   }
+   dst_sz = alu->dest.dest.ssa.num_components;
+   wrmask = (1 << dst_sz) - 1;
 
    dst = ir3_get_dst(ctx, &alu->dest.dest, dst_sz);
 
@@ -513,7 +508,7 @@ emit_alu(struct ir3_context *ctx, nir_alu_instr *alu)
        * src instruction and create a mov.  This is easier for cp
        * to eliminate.
        */
-      if (alu->src[0].src.is_ssa && is_sat_compatible(src[0]->opc) &&
+      if (is_sat_compatible(src[0]->opc) &&
           (list_length(&alu->src[0].src.ssa->uses) == 1)) {
          src[0]->flags |= IR3_INSTR_SAT;
          dst[0] = ir3_MOV(b, src[0], dst_type);
index 89f9d17..1388da4 100644 (file)
@@ -236,9 +236,6 @@ handle_partial_const(nir_builder *b, nir_ssa_def **srcp, int *offp)
    if (alu->op != nir_op_iadd)
       return;
 
-   if (!(alu->src[0].src.is_ssa && alu->src[1].src.is_ssa))
-      return;
-
    if (nir_src_is_const(alu->src[0].src)) {
       *offp += nir_src_as_uint(alu->src[0].src);
       *srcp = alu->src[1].src.ssa;