From bfc05f365cd8d9bf70a68344d91225b34aa85a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Wed, 18 Nov 2020 21:28:09 +0100 Subject: [PATCH] aco/optimizer: Only set scc_needed when it is actually needed. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not every p_cbranch uses the SCC, but our optimizer thought so. Fixes: 8a32f57fff56b3b94f1b5589feba38016f39427c Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: (cherry picked from commit 8bd3fefb74bb731d509f971cc89c687a0fd99feb) --- .pick_status.json | 2 +- src/amd/compiler/aco_optimizer.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 ||