[llvm] AMDGPU: Use OtherPredicates for v_dot2_bf16_bf16(f16_f16) pseudo (PR #84354)

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 10:13:26 PST 2024


https://github.com/changpeng created https://github.com/llvm/llvm-project/pull/84354

  This is because SubtargetPredicate is not copied from pseudo to dpp16 and dpp8 real. Actually this is the common issue for insts with _Realtriple_ --- We should avoid using SubtargetPredicate to define pseudo: the predicate will be lost in real.

>From 08b89ddbfea534ce169349ebc3cb1c1bd1db4b91 Mon Sep 17 00:00:00 2001
From: Changpeng Fang <changpeng.fang at amd.com>
Date: Thu, 7 Mar 2024 10:01:25 -0800
Subject: [PATCH] AMDGPU: Use OtherPredicates for v_dot2_bf16_bf16(f16_f16)
 pseudo

  This is because SubtargetPredicate is not copied from pseudo to
dpp16 and dpp8 real. Actually this is the common issue for insts
with _Realtriple_ --- We should avoid using SubtargetPredicate
to define pseudo: the predicate will be lost in real.
---
 llvm/lib/Target/AMDGPU/VOP3Instructions.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/AMDGPU/VOP3Instructions.td b/llvm/lib/Target/AMDGPU/VOP3Instructions.td
index 334cfad478f151..3340ded9d36000 100644
--- a/llvm/lib/Target/AMDGPU/VOP3Instructions.td
+++ b/llvm/lib/Target/AMDGPU/VOP3Instructions.td
@@ -893,7 +893,7 @@ let SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0 in {
   defm V_MINIMUMMAXIMUM_F16 : VOP3Inst<"v_minimummaximum_f16", VOP3_Profile<VOP_F16_F16_F16_F16, VOP3_OPSEL>>;
 } // End SubtargetPredicate = isGFX12Plus, ReadsModeReg = 0
 
-let SubtargetPredicate = HasDot9Insts, IsDOT=1 in {
+let OtherPredicates = [HasDot9Insts], IsDOT=1 in {
   defm V_DOT2_F16_F16 :   VOP3Inst<"v_dot2_f16_f16",   VOP3_DOT_Profile<VOP_F16_V2F16_V2F16_F16>, int_amdgcn_fdot2_f16_f16>;
   defm V_DOT2_BF16_BF16 : VOP3Inst<"v_dot2_bf16_bf16", VOP3_DOT_Profile<VOP_BF16_V2BF16_V2BF16_BF16>, int_amdgcn_fdot2_bf16_bf16>;
 }



More information about the llvm-commits mailing list