mirror of
https://github.com/intel/llvm.git
synced 2026-01-13 11:02:04 +08:00
[ROCDL] Added asynccnt and tensorcnt wait ops (gfx1250) (#163533)
This patch introduces some missing `s.wait.asynccnt` and `tensorcnt` instructions in the ROCDL dialect. The op is lowered to `@llvm.amdgcn.s.wait.asynccnt(i16 0)` and `@llvm.amdgcn.s.wait.tensorcnt(i16 0)` intrinsic calls
This commit is contained in:
@@ -412,6 +412,32 @@ def ROCDL_WaitExpcntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.expcnt", [], 0, [0],
|
||||
let assemblyFormat = "$count attr-dict";
|
||||
}
|
||||
|
||||
def ROCDL_WaitAsynccntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.asynccnt", [], 0, [0], ["count"]>,
|
||||
Arguments<(ins I16Attr:$count)> {
|
||||
let summary = "Wait until ASYNCCNT is less than or equal to `count`";
|
||||
let description = [{
|
||||
Wait for the counter specified to be less-than or equal-to the `count`
|
||||
before continuing.
|
||||
|
||||
Available on gfx1250+.
|
||||
}];
|
||||
let results = (outs);
|
||||
let assemblyFormat = "$count attr-dict";
|
||||
}
|
||||
|
||||
def ROCDL_WaitTensorcntOp: ROCDL_ConcreteNonMemIntrOp<"s.wait.tensorcnt", [], 0, [0], ["count"]>,
|
||||
Arguments<(ins I16Attr:$count)> {
|
||||
let summary = "Wait until TENSORCNT is less than or equal to `count`";
|
||||
let description = [{
|
||||
Wait for the counter specified to be less-than or equal-to the `count`
|
||||
before continuing.
|
||||
|
||||
Available on gfx1250+.
|
||||
}];
|
||||
let results = (outs);
|
||||
let assemblyFormat = "$count attr-dict";
|
||||
}
|
||||
|
||||
def ROCDL_SetPrioOp : ROCDL_ConcreteNonMemIntrOp<"s.setprio", [], 0, [0], ["priority"]>,
|
||||
Arguments<(ins I16Attr:$priority)> {
|
||||
let assemblyFormat = "$priority attr-dict";
|
||||
|
||||
@@ -1035,6 +1035,20 @@ llvm.func @rocdl.s.wait.expcnt() {
|
||||
llvm.return
|
||||
}
|
||||
|
||||
llvm.func @rocdl.s.wait.asynccnt() {
|
||||
// CHECK-LABEL: rocdl.s.wait.asynccnt
|
||||
// CHECK: rocdl.s.wait.asynccnt 0
|
||||
rocdl.s.wait.asynccnt 0
|
||||
llvm.return
|
||||
}
|
||||
|
||||
llvm.func @rocdl.s.wait.tensorcnt() {
|
||||
// CHECK-LABEL: rocdl.s.wait.tensorcnt
|
||||
// CHECK: rocdl.s.wait.tensorcnt 0
|
||||
rocdl.s.wait.tensorcnt 0
|
||||
llvm.return
|
||||
}
|
||||
|
||||
// -----
|
||||
|
||||
llvm.func @rocdl.readfirstlane(%src : f32) -> f32 {
|
||||
|
||||
@@ -276,6 +276,20 @@ llvm.func @rocdl.s.wait.expcnt() {
|
||||
llvm.return
|
||||
}
|
||||
|
||||
llvm.func @rocdl.s.wait.asynccnt() {
|
||||
// CHECK-LABEL: rocdl.s.wait.asynccnt
|
||||
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.asynccnt(i16 0)
|
||||
rocdl.s.wait.asynccnt 0
|
||||
llvm.return
|
||||
}
|
||||
|
||||
llvm.func @rocdl.s.wait.tensorcnt() {
|
||||
// CHECK-LABEL: rocdl.s.wait.tensorcnt
|
||||
// CHECK-NEXT: call void @llvm.amdgcn.s.wait.tensorcnt(i16 0)
|
||||
rocdl.s.wait.tensorcnt 0
|
||||
llvm.return
|
||||
}
|
||||
|
||||
llvm.func @rocdl.setprio() {
|
||||
// CHECK: call void @llvm.amdgcn.s.setprio(i16 0)
|
||||
rocdl.s.setprio 0
|
||||
|
||||
Reference in New Issue
Block a user