[llvm-branch-commits] [llvm] AMDGPU: Codegen for v_dual_dot2acc_f32_f16/bf16 from VOP3 (PR #179226)
Mirko BrkuĊĦanin via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Feb 18 07:55:18 PST 2026
================
@@ -641,12 +643,37 @@ let SubtargetPredicate = HasDot12Insts in {
defm V_DOT2_F32_BF16 :
VOP3PInstDotWithDual<"v_dot2_f32_bf16", DOT2_BF16_Profile,
- int_amdgcn_fdot2_f32_bf16>;
+ int_amdgcn_fdot2_f32_bf16, 0xD, "v_dot2acc_f32_bf16">;
} // End SubtargetPredicate = HasDot12Insts
} // End let IsDOT = 1
+let IsDOT = 1, OtherPredicates = [HasOnlyDualDot2AccF32F16],
+Constraints = "$vdst = $src2" in
+def V_DOT2ACC_F32_F16_PSEUDO
+ : VOP3P_Pseudo<"", VOP3P_Profile<VOP_F32_V2F16_V2F16_F32, VOP3_REGULAR>>;
+
+class Dot2AccPseudo_Pat <SDPatternOperator node, Instruction inst, ValueType ty>
+ : GCNPat <
+ (f32 (node (ty (VOP3PNoModsDOT ty:$src0)), (ty (VOP3PNoModsDOT ty:$src1)),
+ (f32 (VOP3PNoModsF32 f32:$src2)), (i1 DSTCLAMP.NONE))),
+ (f32 (inst (i32 SRCMODS.OP_SEL_1), $src0, (i32 SRCMODS.OP_SEL_1), $src1,
+ (i32 SRCMODS.OP_SEL_1), $src2))
+>;
+
+let SubtargetPredicate = HasOnlyDualDot2AccF32F16 in
+def : Dot2AccPseudo_Pat<AMDGPUfdot2, V_DOT2ACC_F32_F16_PSEUDO, v2f16>;
+
+let IsDOT = 1, OtherPredicates = [HasOnlyDualDot2AccF32BF16],
+Constraints = "$vdst = $src2" in
+def V_DOT2ACC_F32_BF16_PSEUDO :
+ VOP3P_Pseudo<"", VOP3P_Profile<VOP_F32_V2BF16_V2BF16_F32, VOP3_REGULAR>>;
+
+let SubtargetPredicate = HasOnlyDualDot2AccF32BF16 in
+def : Dot2AccPseudo_Pat<int_amdgcn_fdot2_f32_bf16, V_DOT2ACC_F32_BF16_PSEUDO,
+ v2bf16>;
----------------
mbrkusanin wrote:
Can you please reorder this to:
def pseudo
def pseudo
class pattern
def pattern
def pattern
https://github.com/llvm/llvm-project/pull/179226
More information about the llvm-branch-commits
mailing list