Mesa (staging/20.0): aco: fix creating v_madak if v_mad_f32 has two sgpr literals

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Feb 11 17:59:18 UTC 2020


Module: Mesa
Branch: staging/20.0
Commit: 4558bdb95aa11863780d3a4eed593e6f624222d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4558bdb95aa11863780d3a4eed593e6f624222d8

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Mon Feb 10 12:13:15 2020 +0100

aco: fix creating v_madak if v_mad_f32 has two sgpr literals

Do not ignore that src1 can be a sgpr.

Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2435
Cc: <mesa-stable at lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3759>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3759>
(cherry picked from commit ddd767387f336ed1578f171a2af4ca33c564d7f3)

---

 .pick_status.json                  | 2 +-
 src/amd/compiler/aco_optimizer.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index c1de0e23976..b284884ae11 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -22,7 +22,7 @@
         "description": "aco: fix creating v_madak if v_mad_f32 has two sgpr literals",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/amd/compiler/aco_optimizer.cpp b/src/amd/compiler/aco_optimizer.cpp
index 0b9fccc379e..5f2e5637b71 100644
--- a/src/amd/compiler/aco_optimizer.cpp
+++ b/src/amd/compiler/aco_optimizer.cpp
@@ -2604,7 +2604,7 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
                continue;
             /* if one of the operands is sgpr, we cannot add a literal somewhere else on pre-GFX10 or operands other than the 1st */
             if (instr->operands[i].getTemp().type() == RegType::sgpr && (i > 0 || ctx.program->chip_class < GFX10)) {
-               if (ctx.info[instr->operands[i].tempId()].is_literal()) {
+               if (!sgpr_used && ctx.info[instr->operands[i].tempId()].is_literal()) {
                   literal_uses = ctx.uses[instr->operands[i].tempId()];
                   literal_idx = i;
                } else {



More information about the mesa-commit mailing list