Mesa (master): aco/optimizer: Only set scc_needed when it is actually needed.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 26 16:00:21 UTC 2020


Module: Mesa
Branch: master
Commit: 8bd3fefb74bb731d509f971cc89c687a0fd99feb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8bd3fefb74bb731d509f971cc89c687a0fd99feb

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Wed Nov 18 21:28:09 2020 +0100

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

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

Fixes: 8a32f57fff56b3b94f1b5589feba38016f39427c
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7677>

---

 src/amd/compiler/aco_optimizer.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 651fc272517..0a1f2f8c414 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -3235,7 +3235,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) {
       ctx.info[instr->operands[0].tempId()].set_scc_needed();
       return;
    } else if ((instr->opcode == aco_opcode::s_cselect_b64 ||



More information about the mesa-commit mailing list