aco: don't combine add/mul of different bit-size
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 31 Jan 2022 18:22:58 +0000 (18:22 +0000)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Feb 2022 16:02:04 +0000 (16:02 +0000)
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/14810>

src/amd/compiler/aco_optimizer.cpp

index 1a36394..7dfdb05 100644 (file)
@@ -3571,6 +3571,9 @@ combine_instruction(opt_ctx& ctx, aco_ptr<Instruction>& instr)
          if (info.instr->isVOP3() && (info.instr->vop3().clamp || info.instr->vop3().omod))
             continue;
 
+         if (get_operand_size(instr, i) != info.instr->definitions[0].bytes() * 8)
+            continue;
+
          bool legacy = info.instr->opcode == aco_opcode::v_mul_legacy_f32;
          if (legacy && need_fma && ctx.program->chip_class < GFX10_3)
             continue;