Mesa (staging/19.3): aco: don't combine literals into v_cndmask_b32/v_subb/v_addc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Nov 20 00:54:15 UTC 2019


Module: Mesa
Branch: staging/19.3
Commit: ab4df0ec7269a1846e7cdde0c7bec051f2daf2d7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ab4df0ec7269a1846e7cdde0c7bec051f2daf2d7

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Mon Nov 11 14:15:04 2019 +0000

aco: don't combine literals into v_cndmask_b32/v_subb/v_addc

No pipeline-db changes

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Fixes: 93c8ebfa ('aco: Initial commit of independent AMD compiler')
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
(cherry picked from commit b062b92ab1a6504772a63a6b44f89b4579aef9a3)

---

 src/amd/compiler/aco_optimizer.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index d8a97354602..59adb2301c9 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -469,6 +469,12 @@ bool can_accept_constant(aco_ptr<Instruction>& instr, unsigned operand)
 
 bool valu_can_accept_literal(opt_ctx& ctx, aco_ptr<Instruction>& instr, unsigned operand)
 {
+   /* instructions like v_cndmask_b32 can't take a literal because they always
+    * read SGPRs */
+   if (instr->operands.size() >= 3 &&
+       instr->operands[2].isTemp() && instr->operands[2].regClass().type() == RegType::sgpr)
+      return false;
+
    // TODO: VOP3 can take a literal on GFX10
    return !instr->isSDWA() && !instr->isDPP() && !instr->isVOP3() &&
           operand == 0 && can_accept_constant(instr, operand);




More information about the mesa-commit mailing list