diff --git a/.pick_status.json b/.pick_status.json index fbf7a6a6280..e7f157e400c 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1930,7 +1930,7 @@ "description": "aco/optimizer: Only set scc_needed when it is actually needed.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": "8a32f57fff56b3b94f1b5589feba38016f39427c" }, diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp index 5c7bf2ae5cd..bbb6a4ce00f 100644 --- a/src/amd/compiler/aco_optimizer.cpp +++ b/src/amd/compiler/aco_optimizer.cpp @@ -2986,7 +2986,9 @@ void select_instruction(opt_ctx &ctx, aco_ptr& instr) /* Mark SCC needed, so the uniform boolean transformation won't swap the definitions when it isn't beneficial */ if (instr->format == Format::PSEUDO_BRANCH && instr->operands.size() && - instr->operands[0].isTemp()) { + instr->operands[0].isTemp() && + instr->operands[0].isFixed() && + instr->operands[0].physReg() == scc) { ctx.info[instr->operands[0].tempId()].set_scc_needed(); return; } else if ((instr->opcode == aco_opcode::s_cselect_b64 ||