File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
include/mlir/Dialect/LLVMIR Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -162,10 +162,18 @@ def ROCDL_BallotOp :
162
162
ROCDL_Op<"ballot">,
163
163
Results<(outs LLVM_Type:$res)>,
164
164
Arguments<(ins I1:$pred)> {
165
+ let summary = "Vote across thread group";
166
+
167
+ let description = [{
168
+ Ballot provides a bit mask containing the 1-bit predicate value from each lane.
169
+ The nth bit of the result contains the 1 bit contributed by the nth warp lane.
170
+ }];
171
+
165
172
string llvmBuilder = [{
166
173
$res = createIntrinsicCall(builder,
167
- llvm::Intrinsic::amdgcn_ballot, {$pred}, {llvm::Type::getInt32Ty(moduleTranslation.getLLVMContext()) });
174
+ llvm::Intrinsic::amdgcn_ballot, {$pred}, {$_resultType });
168
175
}];
176
+
169
177
let assemblyFormat = "$pred attr-dict `:` type($res)";
170
178
}
171
179
Original file line number Diff line number Diff line change @@ -88,13 +88,20 @@ 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
91
+ llvm.func @rocdl.ballot32 (%pred : i1 ) -> i32 {
92
+ // CHECK-LABEL: rocdl.ballot32
93
93
// CHECK: call i32 @llvm.amdgcn.ballot
94
94
%0 = rocdl.ballot %pred : i32
95
95
llvm.return %0 : i32
96
96
}
97
97
98
+ llvm.func @rocdl.ballot64 (%pred : i1 ) -> i64 {
99
+ // CHECK-LABEL: rocdl.ballot64
100
+ // CHECK: call i64 @llvm.amdgcn.ballot
101
+ %0 = rocdl.ballot %pred : i64
102
+ llvm.return %0 : i64
103
+ }
104
+
98
105
llvm.func @rocdl.waitcnt () {
99
106
// CHECK-LABEL: rocdl.waitcnt
100
107
// CHECK-NEXT: call void @llvm.amdgcn.s.waitcnt(i32 0)
You can’t perform that action at this time.
0 commit comments