[Mlir-commits] [mlir] [MLIR][ROCDL] Added `SchedGroupBarrier` and `IglpOpt` ops (PR #112237)
Giuseppe Rossini
llvmlistbot at llvm.org
Tue Oct 15 09:54:26 PDT 2024
================
@@ -387,3 +388,26 @@ gpu.module @module_1 [#rocdl.target<O = 1, chip = "gfx900", abi = "500", link =
gpu.module @module_2 [#rocdl.target<chip = "gfx900">, #rocdl.target<chip = "gfx90a">] {
}
+
+// -----
+
+// ROCDL2LLVM: @rocdl_sched_barrier
+func.func @rocdl_sched_barrier() {
+ // ROCDL2LLVM-NEXT: call void @llvm.amdgcn.sched.barrier(i32 0)
+ rocdl.sched.barrier 0
+ llvm.return
+}
+
+// ROCDL2LLVM: @rocdl_sched_group_barrier
+func.func @rocdl_sched_group_barrier() {
+ // ROCDL2LLVM-NEXT: call void @llvm.amdgcn.sched.group.barrier(i32 8, i32 1, i32 0)
+ rocdl.sched.group.barrier 8, 1, 0
+ llvm.return
+}
+
+// ROCDL2LLVM: @rocdl_iglp_opt
+func.func @rocdl_iglp_opt() {
+ // ROCDL2LLVM-NEXT: call void @llvm.amdgcn.iglp.opt(i32 0)
+ rocdl.iglp.opt 0
+ llvm.return
+}
----------------
giuseros wrote:
I think these need to be in different places, namely in : `mlir/test/Target/LLVMIR/rocdl.mlir`. In this file you should put a test on the line of:
```
func.func @rocdl_iglp_opt() {
// CHECK: rocdl.iglp.opt
rocdl.iglp.opt 0
llvm.return
}
```
https://github.com/llvm/llvm-project/pull/112237
More information about the Mlir-commits
mailing list