pan/bi: Don't remove dests in DCE

Removing dests without removing instructions only makes sense for certain
pseudo-instructions, but it makes the IR needlessly complicated for all
instructions. There's no real reason to do so, we can signal this in a different
way instead.

No shader-db changes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17794>
This commit is contained in:
Alyssa Rosenzweig 2022-07-21 15:40:05 -04:00 committed by Marge Bot
parent f52de4621a
commit 75a721f3a8
2 changed files with 7 additions and 8 deletions

View file

@ -46,8 +46,6 @@ bi_opt_dead_code_eliminate(bi_context *ctx)
bool all_null = true;
bi_foreach_dest(ins, d) {
unsigned index = bi_get_node(ins->dest[d]);
/* Destination required */
if (ins->op == BI_OPCODE_AXCHG_I32 ||
ins->op == BI_OPCODE_ACMPXCHG_I32 ||
@ -58,10 +56,12 @@ bi_opt_dead_code_eliminate(bi_context *ctx)
ins->op == BI_OPCODE_ZS_EMIT)
continue;
if (index < temp_count && !(live[index] & bi_writemask(ins, d)))
ins->dest[d] = bi_null();
unsigned index = bi_get_node(ins->dest[d]);
all_null &= bi_is_null(ins->dest[d]);
if (index >= temp_count)
all_null = false;
else if (live[index] & bi_writemask(ins, d))
all_null = false;
}
if (all_null && !bi_side_effects(ins))

View file

@ -718,9 +718,8 @@ bi_lower_vector(bi_context *ctx)
bi_index src = I->src[0];
assert(src.offset == 0);
for (unsigned i = 0; i < I->nr_dests; ++i) {
if (bi_is_null(I->dest[i]))
continue;
bi_foreach_dest(I, i) {
assert(!bi_is_null(I->dest[i]));
src.offset = i;
bi_mov_i32_to(&b, I->dest[i], src);