From abe9b6121284f63e97275a10610f973629d282e4 Mon Sep 17 00:00:00 2001 From: Gert Wollny Date: Wed, 3 Sep 2025 16:20:36 +0200 Subject: [PATCH] r600/sfn: relax restrictions when optimizing predicate evaluation with a register If the comparison comes right before the predicate evaluation it still can be contracted. Signed-off-by: Gert Wollny Part-of: --- src/gallium/drivers/r600/sfn/sfn_peephole.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r600/sfn/sfn_peephole.cpp b/src/gallium/drivers/r600/sfn/sfn_peephole.cpp index 2121dcb6195..8f57d758dae 100644 --- a/src/gallium/drivers/r600/sfn/sfn_peephole.cpp +++ b/src/gallium/drivers/r600/sfn/sfn_peephole.cpp @@ -384,8 +384,10 @@ ReplacePredicate::visit(AluInstr *alu) * R = SOME_OP * IF (COND(R, X)) */ - if (reg && !reg->has_flag(Register::ssa)) - return; + if (reg && !reg->has_flag(Register::ssa)) { + if (m_pred->block_id() != alu->block_id() || m_pred->index() - 1 != alu->index()) + return; + } } m_pred->set_op(new_op);