From efee0ddd9177d7e0fd3b264328bb43f30384f309 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Mon, 25 Jul 2022 15:03:36 -0400 Subject: [PATCH] pan/bi: Assume SSA in CSE Signed-off-by: Alyssa Rosenzweig Part-of: --- src/panfrost/bifrost/bi_opt_cse.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/panfrost/bifrost/bi_opt_cse.c b/src/panfrost/bifrost/bi_opt_cse.c index 218d64e..8d1d46f 100644 --- a/src/panfrost/bifrost/bi_opt_cse.c +++ b/src/panfrost/bifrost/bi_opt_cse.c @@ -47,7 +47,6 @@ hash_index(uint32_t hash, bi_index index) hash = HASH(hash, index.neg); hash = HASH(hash, index.swizzle); hash = HASH(hash, index.offset); - hash = HASH(hash, index.reg); hash = HASH(hash, index.type); return hash; } @@ -140,22 +139,6 @@ instr_can_cse(const bi_instr *I) if (I->branch_target) return false; - /* Refuse to CSE non-SSA destinations since the data flow analysis - * required is nontrivial */ - bi_foreach_dest(I, d) { - if (!bi_is_null(I->dest[d]) && !bi_is_ssa(I->dest[d])) - return false; - } - - /* Similar refuse to CSE non-SSA sources. We allow machine registers, - * since CSE runs before register allocation which means any registers - * encountered are preloaded and hence assumed constant. - */ - bi_foreach_src(I, s) { - if (I->src[s].reg) - return false; - } - return true; } @@ -193,8 +176,7 @@ bi_opt_cse(bi_context *ctx) const bi_instr *match = entry->key; bi_foreach_dest(instr, d) { - if (!bi_is_null(instr->dest[d])) - replacement[instr->dest[d].value] = match->dest[d]; + replacement[instr->dest[d].value] = match->dest[d]; } } } -- 2.7.4