aco: fix literal application with v_cndmask_b32/v_addc_co_u32/etc
authorRhys Perry <pendingchaos02@gmail.com>
Fri, 24 Jan 2020 17:37:11 +0000 (17:37 +0000)
committerRhys Perry <pendingchaos02@gmail.com>
Mon, 27 Jan 2020 14:50:37 +0000 (14:50 +0000)
No pipeline-db changes

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Fixes: 0be74090696 ('aco: rewrite literal combining')
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3541>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3541>

src/amd/compiler/aco_optimizer.cpp

index fbeb76df9902ceed8fe4e12e0b30a1cc49adfa10..93d934c69edd7e5e43a3908ffe99bffdd755c121 100644 (file)
@@ -2674,6 +2674,9 @@ void select_instruction(opt_ctx &ctx, aco_ptr<Instruction>& instr)
    unsigned num_operands = 1;
    if (instr->isSALU() || (ctx.program->chip_class >= GFX10 && can_use_VOP3(ctx, instr)))
       num_operands = instr->operands.size();
+   /* catch VOP2 with a 3rd SGPR operand (e.g. v_cndmask_b32, v_addc_co_u32) */
+   else if (instr->isVALU() && instr->operands.size() >= 3)
+      return;
 
    unsigned sgpr_ids[2] = {0, 0};
    bool is_literal_sgpr = false;