From 187dd382cbb5590f053e1955aa4e344b8aed83de Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 11 May 2022 12:22:10 -0400 Subject: [PATCH] pan/bi: Scalarize bi_lower_swizzle Reduces memory footprint. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_lower_swizzle.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/panfrost/bifrost/bi_lower_swizzle.c b/src/panfrost/bifrost/bi_lower_swizzle.c index f96f9fb7961..f31a1c5c69f 100644 --- a/src/panfrost/bifrost/bi_lower_swizzle.c +++ b/src/panfrost/bifrost/bi_lower_swizzle.c @@ -223,7 +223,7 @@ bi_instr_replicates(bi_instr *I, BITSET_WORD *replicates_16) /* Replicated values */ if (bi_is_ssa(I->src[s]) && - BITSET_TEST(replicates_16, bi_word_node(I->src[s]))) + BITSET_TEST(replicates_16, I->src[s].value)) continue; /* Replicated constants */ @@ -248,14 +248,14 @@ bi_lower_swizzle(bi_context *ctx) } /* Now that we've lowered swizzles, clean up the mess */ - BITSET_WORD *replicates_16 = calloc(sizeof(bi_index), ((ctx->ssa_alloc + 1) << 2)); + BITSET_WORD *replicates_16 = calloc(sizeof(bi_index), ctx->ssa_alloc); bi_foreach_instr_global(ctx, ins) { if (bi_is_ssa(ins->dest[0]) && bi_instr_replicates(ins, replicates_16)) - BITSET_SET(replicates_16, bi_word_node(ins->dest[0])); + BITSET_SET(replicates_16, ins->dest[0].value); if (ins->op == BI_OPCODE_SWZ_V2I16 && bi_is_ssa(ins->src[0]) && - BITSET_TEST(replicates_16, bi_word_node(ins->src[0]))) { + BITSET_TEST(replicates_16, ins->src[0].value)) { ins->op = BI_OPCODE_MOV_I32; ins->src[0].swizzle = BI_SWIZZLE_H01; }