File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed
include/mlir/Dialect/LLVMIR Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,16 @@ Arguments<(ins I32:$index,
158
158
}];
159
159
}
160
160
161
+ def ROCDL_BallotOp :
162
+ ROCDL_Op<"ballot">,
163
+ Results<(outs LLVM_Type:$res)>,
164
+ Arguments<(ins I1:$pred)> {
165
+ string llvmBuilder = [{
166
+ $res = createIntrinsicCall(builder,
167
+ llvm::Intrinsic::amdgcn_ballot, {$pred}, {llvm::Type::getInt32Ty(moduleTranslation.getLLVMContext())});
168
+ }];
169
+ let assemblyFormat = "$pred attr-dict `:` type($res)";
170
+ }
161
171
162
172
//===----------------------------------------------------------------------===//
163
173
// Thread index and Block index
Original file line number Diff line number Diff line change @@ -88,6 +88,13 @@ llvm.func @rocdl.bpermute(%src : i32) -> i32 {
88
88
llvm.return %0 : i32
89
89
}
90
90
91
+ llvm.func @rocdl.ballot (%pred : i1 ) -> i32 {
92
+ // CHECK-LABEL: rocdl.ballot
93
+ // CHECK: call i32 @llvm.amdgcn.ballot
94
+ %0 = rocdl.ballot %pred : i32
95
+ llvm.return %0 : i32
96
+ }
97
+
91
98
llvm.func @rocdl.waitcnt () {
92
99
// CHECK-LABEL: rocdl.waitcnt
93
100
// CHECK-NEXT: call void @llvm.amdgcn.s.waitcnt(i32 0)
You can’t perform that action at this time.
0 commit comments