Mesa (master): aco: use the same regclass as the definition for undef phi operands

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 18 17:41:43 UTC 2020


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Thu Jun 18 13:52:28 2020 +0100

aco: use the same regclass as the definition for undef phi operands

Subdword phis can't have SGPR operands on GFX6-8.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5544>

---

 src/amd/compiler/aco_instruction_selection.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index c0cc445ffa3..4de1b4e8b81 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -8890,11 +8890,11 @@ void visit_tex(isel_context *ctx, nir_tex_instr *instr)
 }
 
 
-Operand get_phi_operand(isel_context *ctx, nir_ssa_def *ssa)
+Operand get_phi_operand(isel_context *ctx, nir_ssa_def *ssa, RegClass rc)
 {
    Temp tmp = get_ssa_temp(ctx, ssa);
    if (ssa->parent_instr->type == nir_instr_type_ssa_undef)
-      return Operand(tmp.regClass());
+      return Operand(rc);
    else
       return Operand(tmp);
 }
@@ -8939,7 +8939,7 @@ void visit_phi(isel_context *ctx, nir_phi_instr *instr)
       if (!(ctx->block->kind & block_kind_loop_header) && cur_pred_idx >= preds.size())
          continue;
       cur_pred_idx++;
-      Operand op = get_phi_operand(ctx, src.second);
+      Operand op = get_phi_operand(ctx, src.second, dst.regClass());
       operands[num_operands++] = op;
       num_defined += !op.isUndefined();
    }



More information about the mesa-commit mailing list