mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 19:00:13 +01:00
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:
parent
f52de4621a
commit
75a721f3a8
2 changed files with 7 additions and 8 deletions
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue