Skip to content

Commit 138dbd5

Browse files
committed
1 parent d813c1e commit 138dbd5

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

external/llvm-project/mlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,32 @@ def ROCDL_WaitExpcntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.expcnt", [], 0, [0],
356356
let assemblyFormat = "$count attr-dict";
357357
}
358358

359+
def ROCDL_WaitAsynccntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.asynccnt", [], 0, [0], ["count"]>,
360+
Arguments<(ins I16Attr:$count)> {
361+
let summary = "Wait until ASYNCCNT is less than or equal to `count`";
362+
let description = [{
363+
Wait for the counter specified to be less-than or equal-to the `count`
364+
before continuing.
365+
366+
Available on gfx1250+.
367+
}];
368+
let results = (outs);
369+
let assemblyFormat = "$count attr-dict";
370+
}
371+
372+
def ROCDL_WaitTensorcntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.tensorcnt", [], 0, [0], ["count"]>,
373+
Arguments<(ins I16Attr:$count)> {
374+
let summary = "Wait until TENSORCNT is less than or equal to `count`";
375+
let description = [{
376+
Wait for the counter specified to be less-than or equal-to the `count`
377+
before continuing.
378+
379+
Available on gfx1250+.
380+
}];
381+
let results = (outs);
382+
let assemblyFormat = "$count attr-dict";
383+
}
384+
359385
def ROCDL_SetPrioOp : ROCDL_ConcreteNonMemIntrOp<"s.setprio", [], 0, [0], ["priority"]>,
360386
Arguments<(ins I16Attr:$priority)> {
361387
let assemblyFormat = "$priority attr-dict";

external/llvm-project/mlir/test/Dialect/LLVMIR/rocdl.mlir

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,20 @@ llvm.func @rocdl.s.wait.expcnt() {
992992
llvm.return
993993
}
994994

995+
llvm.func @rocdl.s.wait.asynccnt() {
996+
// CHECK-LABEL: rocdl.s.wait.asynccnt
997+
// CHECK: rocdl.s.wait.asynccnt 0
998+
rocdl.s.wait.asynccnt 0
999+
llvm.return
1000+
}
1001+
1002+
llvm.func @rocdl.s.wait.tensorcnt() {
1003+
// CHECK-LABEL: rocdl.s.wait.tensorcnt
1004+
// CHECK: rocdl.s.wait.tensorcnt 0
1005+
rocdl.s.wait.tensorcnt 0
1006+
llvm.return
1007+
}
1008+
9951009
// -----
9961010

9971011
llvm.func @rocdl.readfirstlane(%src : f32) -> f32 {

external/llvm-project/mlir/test/Target/LLVMIR/rocdl.mlir

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,20 @@ llvm.func @rocdl.s.wait.expcnt() {
234234
llvm.return
235235
}
236236

237+
llvm.func @rocdl.s.wait.asynccnt() {
238+
// CHECK-LABEL: rocdl.s.wait.asynccnt
239+
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.asynccnt(i16 0)
240+
rocdl.s.wait.asynccnt 0
241+
llvm.return
242+
}
243+
244+
llvm.func @rocdl.s.wait.tensorcnt() {
245+
// CHECK-LABEL: rocdl.s.wait.tensorcnt
246+
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.tensorcnt(i16 0)
247+
rocdl.s.wait.tensorcnt 0
248+
llvm.return
249+
}
250+
237251
llvm.func @rocdl.setprio() {
238252
// CHECK: call void @llvm.amdgcn.s.setprio(i16 0)
239253
rocdl.s.setprio 0

0 commit comments

Comments
 (0)