r600/sfn: work around injecting extra CF's to handle hardware bugs
authorGert Wollny <gert.wollny@collabora.com>
Thu, 10 Aug 2023 15:05:58 +0000 (17:05 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Aug 2023 18:21:12 +0000 (18:21 +0000)
The clause local registers can't be used if a new CF is started, but
the assembler still may introduce a CFs to work around some hardware bug,
so make sure RA doesn't assume that the predicate ALU op is in the same ALU
CF like the ALU ops before.

This is a hotfix, the scheduler should handle this better.

Fixes:  cfbd1fd41300740154f89b4382e4790e61c1bf0b
    r600/sfn: Use clause local registers in RA

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24611>

src/gallium/drivers/r600/sfn/sfn_liverangeevaluator.cpp

index f551aaa..13e2955 100644 (file)
@@ -389,8 +389,11 @@ LiveRangeInstrVisitor::visit(ControlFlowInstr *instr)
 void
 LiveRangeInstrVisitor::visit(IfInstr *instr)
 {
+   int b = m_block;
+   m_block = -1;
    instr->predicate()->accept(*this);
    scope_if();
+   m_block = b;
 }
 
 void