@@ -93,19 +93,22 @@ class ROCDL_IntrPure1Op<string mnemonic> :
9393
9494class ROCDL_IntrOp<string mnemonic, list<int> overloadedResults,
9595 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 = [],
9799 list<string> immArgAttrNames = []> :
98100 LLVM_IntrOpBase<ROCDL_Dialect, mnemonic,
99101 "amdgcn_" # !subst(".", "_", mnemonic), overloadedResults,
100102 overloadedOperands, traits, numResults, requiresAccessGroup,
101- requiresAliasAnalysis, 0, 0, 0, immArgPositions, immArgAttrNames>;
103+ requiresAliasAnalysis, 0, requiresArgAndResultAttrs, 0,
104+ immArgPositions, immArgAttrNames>;
102105
103106// Subclass to save typing and ease readibility when there aren't overloaded
104107// operands or memory accesses.
105108class ROCDL_ConcreteNonMemIntrOp<string mnemonic, list<Trait> traits,
106109 int numResults, list<int> immArgPositions = [],
107110 list<string> immArgNames = []>
108- : ROCDL_IntrOp<mnemonic, [], [], traits, numResults, 0, 0,
111+ : ROCDL_IntrOp<mnemonic, [], [], traits, numResults, 0, 0, 0,
109112 immArgPositions, immArgNames>;
110113//===----------------------------------------------------------------------===//
111114// ROCDL special register op definitions
@@ -148,8 +151,11 @@ class ROCDL_DimGetterFunctionOp<string mnemonic, string device_function,
148151//===----------------------------------------------------------------------===//
149152
150153class 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);
153159 let assemblyFormat = [{
154160 $in0 `,` $in1 attr-dict `:` `(` type($in0) `,` type($in1) `)` `->` type($res)
155161 }];
@@ -501,7 +507,7 @@ def ROCDL_ds_read_tr16_b64 : ROCDL_LDS_Read_Tr_IntrOp<"ds.read.tr16.b64">;
501507//===---------------------------------------------------------------------===//
502508
503509def ROCDL_LoadToLDSOp :
504- ROCDL_IntrOp<"load.to.lds", [], [0], [], 0, 0, 1, [2, 3, 4], ["size", "offset", "aux"]> {
510+ ROCDL_IntrOp<"load.to.lds", [], [0], [], 0, 0, 1, 0, [2, 3, 4], ["size", "offset", "aux"]> {
505511 dag args = (ins Arg<LLVM_AnyPointer, "", [MemRead]>:$globalPtr,
506512 Arg<ROCDLBufferLDS, "", [MemWrite]>:$ldsPtr,
507513 I32Attr:$size,
@@ -520,7 +526,7 @@ def ROCDL_LoadToLDSOp :
520526}
521527
522528def ROCDL_GlobalLoadLDSOp :
523- ROCDL_IntrOp<"global.load.lds", [], [], [], 0, 0, 1, [2, 3, 4], ["size", "offset", "aux"]> {
529+ ROCDL_IntrOp<"global.load.lds", [], [], [], 0, 0, 1, 0, [2, 3, 4], ["size", "offset", "aux"]> {
524530 dag args = (ins Arg<ROCDLGlobalBuffer, "", [MemRead]>:$globalPtr,
525531 Arg<ROCDLBufferLDS, "", [MemWrite]>:$ldsPtr,
526532 I32Attr:$size,
@@ -734,7 +740,7 @@ def ROCDL_RawBufferAtomicUMinOp :
734740
735741// DPP Update intrinsic
736742def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
737- [AllTypesMatch<["res", "src", "old"]>], 1, 0, 0,
743+ [AllTypesMatch<["res", "src", "old"]>], 1, 0, 0, 0,
738744 [2, 3, 4, 5], ["dppCtrl", "rowMask", "bankMask", "boundCtrl"]>,
739745 Arguments<(ins LLVM_Type:$old, LLVM_Type:$src, I32Attr:$dppCtrl, I32Attr:$rowMask,
740746 I32Attr:$bankMask, I1Attr:$boundCtrl)> {
@@ -746,7 +752,7 @@ def ROCDL_DPPUpdateOp : ROCDL_IntrOp<"update.dpp", [], [0],
746752
747753// PermLaneX16 intrinsic operation
748754def ROCDL_PermlaneX16Op : ROCDL_IntrOp<"permlanex16", [], [0],
749- [AllTypesMatch<["res", "old", "src0"]>, AllTypesMatch<["src1", "src2"]>], 1, 0, 0,
755+ [AllTypesMatch<["res", "old", "src0"]>, AllTypesMatch<["src1", "src2"]>], 1, 0, 0, 0,
750756 [4, 5], ["fi", "boundControl"]>,
751757 Arguments<(ins LLVM_Type:$old, LLVM_Type:$src0, LLVM_Type:$src1, LLVM_Type:$src2,
752758 I1Attr:$fi, I1Attr:$boundControl)> {
0 commit comments