From d3acfd9be825b04921b773e9cc005504a6a40a6a Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 26 Jul 2022 11:52:29 -0400 Subject: [PATCH] pan/bi: Simplify bi_get_index prototype 2/3 of its arguments are now unused. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_ra.c | 3 +-- src/panfrost/bifrost/bifrost_compile.c | 2 +- src/panfrost/bifrost/compiler.h | 9 ++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/panfrost/bifrost/bi_ra.c b/src/panfrost/bifrost/bi_ra.c index 746e038..0ec6b59 100644 --- a/src/panfrost/bifrost/bi_ra.c +++ b/src/panfrost/bifrost/bi_ra.c @@ -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. diff --git a/src/panfrost/bifrost/bifrost_compile.c b/src/panfrost/bifrost/bifrost_compile.c index eef3436..5b3b7f1 100644 --- a/src/panfrost/bifrost/bifrost_compile.c +++ b/src/panfrost/bifrost/bifrost_compile.c @@ -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 diff --git a/src/panfrost/bifrost/compiler.h b/src/panfrost/bifrost/compiler.h index 344e4da..316093f 100644 --- a/src/panfrost/bifrost/compiler.h +++ b/src/panfrost/bifrost/compiler.h @@ -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 */ -- 2.7.4