[Mlir-commits] [llvm] [mlir] [Flang] [OpenMP] Add LLVM lowering support for PRIORITY in TASK (PR #120710)
Kiran Chandramohan
llvmlistbot at llvm.org
Fri Dec 20 04:55:09 PST 2024
================
@@ -2834,6 +2834,42 @@ llvm.func @omp_taskgroup_task(%x: i32, %y: i32, %zaddr: !llvm.ptr) {
// -----
+llvm.func @test_01() attributes {sym_visibility = "private"}
+llvm.func @test_02() attributes {sym_visibility = "private"}
+// CHECK-LABEL: define void @_QPomp_task_priority() {
+llvm.func @_QPomp_task_priority() {
+ %0 = llvm.mlir.constant(1 : i64) : i64
+ %1 = llvm.alloca %0 x i32 {bindc_name = "x"} : (i64) -> !llvm.ptr
+ %2 = llvm.mlir.constant(4 : i32) : i32
+ %3 = llvm.mlir.constant(true) : i1
+ %4 = llvm.load %1 : !llvm.ptr -> i32
+// CHECK: %[[Gid_01:.*]] = call i32 @__kmpc_global_thread_num(ptr {{.*}})
+// CHECK: %[[I_01:.*]] = call ptr @__kmpc_omp_task_alloc(ptr {{.*}}, i32 %[[Gid_01:.*]], i32 33, i64 40, i64 0, ptr @{{.*}})
+// CHECK: %[[I_02:.*]] = getelementptr inbounds { ptr }, ptr %[[I_01:.*]], i32 0, i32 0
+// CHECK: %[[I_03:.*]] = getelementptr inbounds { ptr, ptr, i32, ptr, ptr }, ptr %[[I_02:.*]], i32 0, i32 4
+// CHECK: store i32 %[[I_00:.*]], ptr %[[I_03:.*]], align 4
+// CHECK: %{{.*}} = call i32 @__kmpc_omp_task(ptr {{.*}}, i32 %[[Gid_01:.*]], ptr %[[I_01:.*]])
+ omp.task priority(%4 : i32) {
+ llvm.call @test_01() : () -> ()
+ omp.terminator
+ }
+// CHECK: %[[Gid_02:.*]] = call i32 @__kmpc_global_thread_num(ptr {{.*}})
----------------
kiranchandramohan wrote:
```suggestion
// CHECK: %[[GID_02:.*]] = call i32 @__kmpc_global_thread_num(ptr {{.*}})
```
https://github.com/llvm/llvm-project/pull/120710
More information about the Mlir-commits
mailing list