@@ -93,19 +93,22 @@ class ROCDL_IntrPure1Op<string mnemonic> :
93
93
94
94
class ROCDL_IntrOp<string mnemonic, list<int> overloadedResults,
95
95
list<int> overloadedOperands, list<Trait> traits, int numResults,
96
- int requiresAccessGroup = 0, int requiresAliasAnalysis = 0, list<int> immArgPositions = [],
96
+ int requiresAccessGroup = 0, int requiresAliasAnalysis = 0,
97
+ int requiresArgAndResultAttrs = 0,
98
+ list<int> immArgPositions = [],
97
99
list<string> immArgAttrNames = []> :
98
100
LLVM_IntrOpBase<ROCDL_Dialect, mnemonic,
99
101
"amdgcn_" # !subst(".", "_", mnemonic), overloadedResults,
100
102
overloadedOperands, traits, numResults, requiresAccessGroup,
101
- requiresAliasAnalysis, 0, 0, 0, immArgPositions, immArgAttrNames>;
103
+ requiresAliasAnalysis, 0, requiresArgAndResultAttrs, 0,
104
+ immArgPositions, immArgAttrNames>;
102
105
103
106
// Subclass to save typing and ease readibility when there aren't overloaded
104
107
// operands or memory accesses.
105
108
class ROCDL_ConcreteNonMemIntrOp<string mnemonic, list<Trait> traits,
106
109
int numResults, list<int> immArgPositions = [],
107
110
list<string> immArgNames = []>
108
- : ROCDL_IntrOp<mnemonic, [], [], traits, numResults, 0, 0,
111
+ : ROCDL_IntrOp<mnemonic, [], [], traits, numResults, 0, 0, 0,
109
112
immArgPositions, immArgNames>;
110
113
//===----------------------------------------------------------------------===//
111
114
// ROCDL special register op definitions
@@ -148,8 +151,11 @@ class ROCDL_DimGetterFunctionOp<string mnemonic, string device_function,
148
151
//===----------------------------------------------------------------------===//
149
152
150
153
class ROCDL_MbcntOp<string mnemonic> :
151
- ROCDL_IntrPure1Op<"mbcnt." # mnemonic>,
152
- Arguments<(ins I32:$in0, I32:$in1)> {
154
+ ROCDL_IntrOp<"mbcnt." # mnemonic, [], [], [Pure], 1,
155
+ 0, 0, /*requiresArgAndResultAttrs=*/1> {
156
+ dag args = (ins I32:$in0, I32:$in1);
157
+ let arguments = !con(args, baseArgs);
158
+ let results = (outs I32:$res);
153
159
let assemblyFormat = [{
154
160
$in0 `,` $in1 attr-dict `:` `(` type($in0) `,` type($in1) `)` `->` type($res)
155
161
}];
@@ -515,7 +521,7 @@ def ROCDL_ds_read_tr16_b64 : ROCDL_LDS_Read_Tr_IntrOp<"ds.read.tr16.b64">;
515
521
//===---------------------------------------------------------------------===//
516
522
517
523
def ROCDL_LoadToLDSOp :
518
- ROCDL_IntrOp<"load.to.lds", [], [0], [], 0, 0, 1, [2, 3, 4], ["size", "offset", "aux"]> {
524
+ ROCDL_IntrOp<"load.to.lds", [], [0], [], 0, 0, 1, 0, [2, 3, 4], ["size", "offset", "aux"]> {
519
525
dag args = (ins Arg<LLVM_AnyPointer, "", [MemRead]>:$globalPtr,
520
526
Arg<ROCDLBufferLDS, "", [MemWrite]>:$ldsPtr,
521
527
I32Attr:$size,
@@ -534,7 +540,7 @@ def ROCDL_LoadToLDSOp :
534
540
}
535
541
536
542
def ROCDL_GlobalLoadLDSOp :
537
- ROCDL_IntrOp<"global.load.lds", [], [], [], 0, 0, 1, [2, 3, 4], ["size", "offset", "aux"]> {
543
+ ROCDL_IntrOp<"global.load.lds", [], [], [], 0, 0, 1, 0, [2, 3, 4], ["size", "offset", "aux"]> {
538
544
dag args = (ins Arg<ROCDLGlobalBuffer, "", [MemRead]>:$globalPtr,
539
545
Arg<ROCDLBufferLDS, "", [MemWrite]>:$ldsPtr,
540
546
I32Attr:$size,
@@ -748,7 +754,7 @@ def ROCDL_RawBufferAtomicUMinOp :
748
754
749
755
// DPP Update intrinsic
750
756
def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
751
- [AllTypesMatch<["res", "src", "old"]>], 1, 0, 0,
757
+ [AllTypesMatch<["res", "src", "old"]>], 1, 0, 0, 0,
752
758
[2, 3, 4, 5], ["dppCtrl", "rowMask", "bankMask", "boundCtrl"]>,
753
759
Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
754
760
I32Attr:$bankMask, I1Attr:$boundCtrl)> {
@@ -760,7 +766,7 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
760
766
761
767
// PermLaneX16 intrinsic operation
762
768
def ROCDL_PermlaneX16Op : ROCDL_IntrOp<"permlanex16", [], [0],
763
- [AllTypesMatch<["res", "old", "src0"]>, AllTypesMatch<["src1", "src2"]>], 1, 0, 0,
769
+ [AllTypesMatch<["res", "old", "src0"]>, AllTypesMatch<["src1", "src2"]>], 1, 0, 0, 0,
764
770
[4, 5], ["fi", "boundControl"]>,
765
771
Arguments<(ins LLVM_Type:$old, LLVM_Type:$src0, LLVM_Type:$src1, LLVM_Type:$src2,
766
772
I1Attr:$fi, I1Attr:$boundControl)> {
0 commit comments