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;