From e332e2edc174159b1eed71de6aef87848ba2439b Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 11 May 2022 12:24:22 -0400 Subject: [PATCH] pan/bi: Scalarize bi_opt_cse Reduces memory footprint. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_opt_cse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/panfrost/bifrost/bi_opt_cse.c b/src/panfrost/bifrost/bi_opt_cse.c index 7c8bc42..bf1122e 100644 --- a/src/panfrost/bifrost/bi_opt_cse.c +++ b/src/panfrost/bifrost/bi_opt_cse.c @@ -157,7 +157,7 @@ bi_opt_cse(bi_context *ctx) struct set *instr_set = _mesa_set_create(NULL, hash_instr, instrs_equal); bi_foreach_block(ctx, block) { - bi_index *replacement = calloc(sizeof(bi_index), ((ctx->ssa_alloc + 1) << 2)); + bi_index *replacement = calloc(sizeof(bi_index), ctx->ssa_alloc); _mesa_set_clear(instr_set, NULL); bi_foreach_instr_in_block(block, instr) { @@ -170,7 +170,7 @@ bi_opt_cse(bi_context *ctx) if (!bi_is_ssa(instr->src[s])) continue; - bi_index repl = replacement[bi_word_node(instr->src[s])]; + bi_index repl = replacement[instr->src[s].value]; if (!bi_is_null(repl)) instr->src[s] = bi_replace_index(instr->src[s], repl); } @@ -186,7 +186,7 @@ bi_opt_cse(bi_context *ctx) bi_foreach_dest(instr, d) { if (!bi_is_null(instr->dest[d])) - replacement[bi_word_node(instr->dest[d])] = match->dest[d]; + replacement[instr->dest[d].value] = match->dest[d]; } } } -- 2.7.4