Skip to content

Commit 1704029

Browse files
committed
1 parent 951d3c0 commit 1704029

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
@@ -1006,6 +1006,20 @@ llvm.func @rocdl.s.wait.expcnt() {
10061006
llvm.return
10071007
}
10081008

1009+
llvm.func @rocdl.s.wait.asynccnt() {
1010+
// CHECK-LABEL: rocdl.s.wait.asynccnt
1011+
// CHECK: rocdl.s.wait.asynccnt 0
1012+
rocdl.s.wait.asynccnt 0
1013+
llvm.return
1014+
}
1015+
1016+
llvm.func @rocdl.s.wait.tensorcnt() {
1017+
// CHECK-LABEL: rocdl.s.wait.tensorcnt
1018+
// CHECK: rocdl.s.wait.tensorcnt 0
1019+
rocdl.s.wait.tensorcnt 0
1020+
llvm.return
1021+
}
1022+
10091023
// -----
10101024

10111025
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)