ir3/sched: Consider unused destinations when computing live effect

If an instruction's destination is unused, then we shouldn't penalize
it. For example, this helps us schedule atomic operations whose results
aren't read. This works around RA failures when CSE is enabled in some
robustness2 tests.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9842>
This commit is contained in:
Connor Abbott 2021-04-26 23:37:04 +02:00 committed by Emma Anholt
parent ba8efeb7fa
commit b1a1de76e8

View file

@ -501,7 +501,7 @@ static int
live_effect(struct ir3_instruction *instr)
{
struct ir3_sched_node *n = instr->data;
int new_live = n->partially_live ? 0 : dest_regs(instr);
int new_live = (n->partially_live || !instr->uses || instr->uses->entries == 0) ? 0 : dest_regs(instr);
int freed_live = 0;
/* if we schedule something that causes a vecN to be live,