From f7cc7079b0d2e3499c71fce1d08bac4b94ae745e Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 18 Jun 2020 13:52:28 +0100 Subject: [PATCH] aco: use the same regclass as the definition for undef phi operands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Subdword phis can't have SGPR operands on GFX6-8. Signed-off-by: Rhys Perry Reviewed-by: Daniel Schürmann Part-of: --- 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 c0cc445..4de1b4e 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(); } -- 2.7.4