pan/bi: Simplify bi_get_index prototype
authorAlyssa Rosenzweig <alyssa@collabora.com>
Tue, 26 Jul 2022 15:52:29 +0000 (11:52 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 2 Sep 2022 16:03:24 +0000 (16:03 +0000)
2/3 of its arguments are now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>

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

index 746e038..0ec6b59 100644 (file)
@@ -1129,8 +1129,7 @@ bi_register_allocate(bi_context *ctx)
                                 spill_count = ALIGN_POT(spill_count, 16);
 
                         spill_count += bi_spill_register(ctx,
-                                        bi_get_index(spill_node, false, 0),
-                                        spill_count);
+                                        bi_get_index(spill_node), spill_count);
 
                         /* In case the spill affected an instruction with tied
                          * operands, we need to fix up.
index eef3436..5b3b7f1 100644 (file)
@@ -1949,7 +1949,7 @@ bi_emit_load_const(bi_builder *b, nir_load_const_instr *instr)
                 acc |= (v << (i * instr->def.bit_size));
         }
 
-        bi_mov_i32_to(b, bi_get_index(instr->def.index, false, 0), bi_imm_u32(acc));
+        bi_mov_i32_to(b, bi_get_index(instr->def.index), bi_imm_u32(acc));
 }
 
 static bi_index
index 344e4da..316093f 100644 (file)
@@ -138,12 +138,11 @@ typedef struct {
 } bi_index;
 
 static inline bi_index
-bi_get_index(unsigned value, bool is_reg, unsigned offset)
+bi_get_index(unsigned value)
 {
         return (bi_index) {
                 .value = value,
                 .swizzle = BI_SWIZZLE_H01,
-                .offset = offset,
                 .type = BI_INDEX_NORMAL,
         };
 }
@@ -917,7 +916,7 @@ va_zero_lut()
 static inline bi_index
 bi_temp(bi_context *ctx)
 {
-        return bi_get_index(ctx->ssa_alloc++, false, 0);
+        return bi_get_index(ctx->ssa_alloc++);
 }
 
 /* Inline constants automatically, will be lowered out by bi_lower_fau where a
@@ -931,7 +930,7 @@ bi_src_index(nir_src *src)
                 return bi_imm_u32(nir_src_as_uint(*src));
         } else {
                 assert(src->is_ssa);
-                return bi_get_index(src->ssa->index, false, 0);
+                return bi_get_index(src->ssa->index);
         }
 }
 
@@ -939,7 +938,7 @@ static inline bi_index
 bi_dest_index(nir_dest *dst)
 {
         assert(dst->is_ssa);
-        return bi_get_index(dst->ssa.index, false, 0);
+        return bi_get_index(dst->ssa.index);
 }
 
 /* Iterators for Bifrost IR */