From bb87832ce0b5828b2d49db00e78a68f3d78865d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Mon, 18 Nov 2024 14:40:36 +0100 Subject: [PATCH] aco/insert_NOPs: add early exit to handle_valu_partial_forwarding_hazard_instr No need to continue if there was already a hazard found in a different control flow path. Part-of: --- src/amd/compiler/aco_insert_NOPs.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/amd/compiler/aco_insert_NOPs.cpp b/src/amd/compiler/aco_insert_NOPs.cpp index 45a14ab4704..0ac55ba73b4 100644 --- a/src/amd/compiler/aco_insert_NOPs.cpp +++ b/src/amd/compiler/aco_insert_NOPs.cpp @@ -1252,6 +1252,10 @@ handle_valu_partial_forwarding_hazard_instr(VALUPartialForwardingHazardGlobalSta VALUPartialForwardingHazardBlockState& block_state, aco_ptr& instr) { + /* Check if there is already a hazard found on some other control flow path. */ + if (global_state.hazard_found) + return true; + if (instr->isSALU() && !instr->definitions.empty()) { if (block_state.state == written_after_exec_write && instr->writes_exec()) block_state.state = exec_written;