[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:08 PST 2024


================
@@ -1958,6 +1963,30 @@ OpenMPIRBuilder::InsertPointOrErrorTy OpenMPIRBuilder::createTask(
                            SharedsSize);
     }
 
+    if (Priority) {
+      //
+      // The return type of "__kmpc_omp_task_alloc" is "kmp_task_t *",
+      // we populate the priority information into the "kmp_task_t" here
+      //
+      // The struct "kmp_task_t" definition is available in kmp.h
+      // kmp_task_t = { shareds, routine, part_id, data1, data2 }
+      // data2 is used for priority
+      //
+      Type *Int32Ty = Builder.getInt32Ty();
+      // kmp_task_t* => { ptr }
+      Type *taskPtr = StructType::get(VoidPtr);
----------------
kiranchandramohan wrote:

```suggestion
      Type *TaskPtr = StructType::get(VoidPtr);
```
And for other variables. While this is slightly confusing because MLIR's is somewhat different but we have to stick to the guidelines.
https://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly
```
Variable names should be nouns (as they represent state). The name should be camel case, and start with an upper case letter (e.g. Leader or Boats).
```

https://github.com/llvm/llvm-project/pull/120710


More information about the Mlir-commits mailing list