Commit bfc05f36 authored by Timur Kristóf's avatar Timur Kristóf Committed by Dylan Baker
Browse files

aco/optimizer: Only set scc_needed when it is actually needed.

Not every p_cbranch uses the SCC, but our optimizer thought so.

Fixes: 8a32f57f

Signed-off-by: Timur Kristóf's avatarTimur Kristóf <>
Reviewed-by: Daniel Schürmann's avatarDaniel Schürmann <>
Part-of: <!7677>
(cherry picked from commit 8bd3fefb)
parent 2a74f0ce
......@@ -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"
......@@ -2986,7 +2986,9 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& 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) {[instr->operands[0].tempId()].set_scc_needed();
} else if ((instr->opcode == aco_opcode::s_cselect_b64 ||
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment