[llvm] r372151 - [AMDGPU] Added MI bit IsDOT
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 10:56:13 PDT 2019
Author: rampitec
Date: Tue Sep 17 10:56:13 2019
New Revision: 372151
URL: http://llvm.org/viewvc/llvm-project?rev=372151&view=rev
Log:
[AMDGPU] Added MI bit IsDOT
NFC, needed for future commit.
Differential Revision: https://reviews.llvm.org/D67669
Modified:
llvm/trunk/lib/Target/AMDGPU/SIDefines.h
llvm/trunk/lib/Target/AMDGPU/SIInstrFormats.td
llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h
llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td
llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td
llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td
Modified: llvm/trunk/lib/Target/AMDGPU/SIDefines.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIDefines.h?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIDefines.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIDefines.h Tue Sep 17 10:56:13 2019
@@ -99,7 +99,10 @@ enum : uint64_t {
FPAtomic = UINT64_C(1) << 53,
// Is a MFMA instruction.
- IsMAI = UINT64_C(1) << 54
+ IsMAI = UINT64_C(1) << 54,
+
+ // Is a DOT instruction.
+ IsDOT = UINT64_C(1) << 55
};
// v_cmp_class_* etc. use a 10-bit mask for what operation is checked.
Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrFormats.td?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrFormats.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrFormats.td Tue Sep 17 10:56:13 2019
@@ -124,6 +124,9 @@ class InstSI <dag outs, dag ins, string
// This bit indicates that this is one of MFMA instructions.
field bit IsMAI = 0;
+ // This bit indicates that this is one of DOT instructions.
+ field bit IsDOT = 0;
+
// These need to be kept in sync with the enum in SIInstrFlags.
let TSFlags{0} = SALU;
let TSFlags{1} = VALU;
@@ -189,6 +192,8 @@ class InstSI <dag outs, dag ins, string
let TSFlags{54} = IsMAI;
+ let TSFlags{55} = IsDOT;
+
let SchedRW = [Write32Bit];
field bits<1> DisableSIDecoder = 0;
Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.h Tue Sep 17 10:56:13 2019
@@ -578,6 +578,14 @@ public:
return get(Opcode).TSFlags & SIInstrFlags::IsMAI;
}
+ static bool isDOT(const MachineInstr &MI) {
+ return MI.getDesc().TSFlags & SIInstrFlags::IsDOT;
+ }
+
+ bool isDOT(uint16_t Opcode) const {
+ return get(Opcode).TSFlags & SIInstrFlags::IsDOT;
+ }
+
static bool isScalarUnit(const MachineInstr &MI) {
return MI.getDesc().TSFlags & (SIInstrFlags::SALU | SIInstrFlags::SMRD);
}
Modified: llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIInstrInfo.td Tue Sep 17 10:56:13 2019
@@ -2139,6 +2139,7 @@ class VOPProfile <list<ValueType> _ArgVT
field int NeedPatGen = PatGenMode.NoPattern;
field bit IsMAI = 0;
+ field bit IsDOT = 0;
field Operand Src0PackedMod = !if(HasSrc0FloatMods, PackedF16InputMods, PackedI16InputMods);
field Operand Src1PackedMod = !if(HasSrc1FloatMods, PackedF16InputMods, PackedI16InputMods);
Modified: llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/VOP2Instructions.td Tue Sep 17 10:56:13 2019
@@ -653,7 +653,8 @@ defm V_FMAC_F32 : VOP2Inst <"v_fmac_f32"
let Constraints = "$vdst = $src2",
DisableEncoding="$src2",
isConvertibleToThreeAddress = 1,
- isCommutable = 1 in {
+ isCommutable = 1,
+ IsDOT = 1 in {
let SubtargetPredicate = HasDot5Insts in
defm V_DOT2C_F32_F16 : VOP2Inst_e32<"v_dot2c_f32_f16", VOP_DOT_ACC_F32_V2F16>;
let SubtargetPredicate = HasDot6Insts in
Modified: llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td?rev=372151&r1=372150&r2=372151&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td (original)
+++ llvm/trunk/lib/Target/AMDGPU/VOP3PInstructions.td Tue Sep 17 10:56:13 2019
@@ -261,6 +261,7 @@ class SDot2Pat<Instruction Inst> : GCNPa
let SubtargetPredicate = !cast<VOP_Pseudo>(Inst).SubtargetPredicate;
}
+let IsDOT = 1 in {
let SubtargetPredicate = HasDot2Insts in {
def V_DOT2_F32_F16 : VOP3PInst<"v_dot2_f32_f16", VOP3_Profile<VOP_F32_V2F16_V2F16_F32>>;
@@ -277,6 +278,7 @@ def V_DOT4_I32_I8 : VOP3PInst<"v_dot4_i
def V_DOT8_I32_I4 : VOP3PInst<"v_dot8_i32_i4", VOP3_Profile<VOP_I32_I32_I32_I32, VOP3_PACKED>>;
} // End SubtargetPredicate = HasDot1Insts
+} // End let IsDOT = 1
multiclass DotPats<SDPatternOperator dot_op,
VOP3PInst dot_inst> {
More information about the llvm-commits
mailing list