From: Rhys Perry Date: Thu, 18 Jun 2020 12:52:28 +0000 (+0100) Subject: aco: use the same regclass as the definition for undef phi operands X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7cc7079b0d2e3499c71fce1d08bac4b94ae745e;p=mesa.git 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 Reviewed-by: Daniel Schürmann Part-of: --- 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(); }