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@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5544>
This commit is contained in:
Rhys Perry 2020-06-18 13:52:28 +01:00 committed by Marge Bot
parent 897a47d847
commit f7cc7079b0

View file

@ -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();
}