[PATCH] D77634: [MLIR] Support for taskwait and taskyield operations, and translating the same to LLVM IR

Kiran Chandramohan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 7 10:20:56 PDT 2020


kiranchandramohan added a subscriber: rogfer01.
kiranchandramohan added a comment.

Thanks @kiranktp for working on this. Looks OK to me.

Just pinging @rogfer01 since he wrote the portion of the builder for taskwait and taskyield.



================
Comment at: mlir/lib/Target/LLVMIR/ModuleTranslation.cpp:292-293
 
+/// Given a single OpenMP MLIR operation, create the corresponding LLVM IR
+/// operation.
+LogicalResult
----------------
There might be more than one LLVM IR operation corresponding to an OpenMP MLIR operation.

Would the following be better?
Given an OpenMP MLIR operation, create the corresponding LLVM IR (including OpenMP runtime calls).


================
Comment at: mlir/test/Target/openmp-llvm.mlir:6-9
+// CHECK: [[OMP_THREAD1:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{[0-9]+}})
+// CHECK-NEXT:  [[RET_VAL:%.*]] = call i32 @__kmpc_omp_taskwait(%struct.ident_t* @{{[0-9]+}}, i32 [[OMP_THREAD1]])
+// CHECK: [[OMP_THREAD2:%.*]] = call i32 @__kmpc_global_thread_num(%struct.ident_t* @{{[0-9]+}})
+// CHECK-NEXT:  [[RET_VAL:%.*]] = call i32 @__kmpc_omp_taskyield(%struct.ident_t* @{{[0-9]+}}, i32 [[OMP_THREAD2]], i32 0)
----------------
Should we move all these checks closer to the operation? What is the MLIR/LLVM style for this?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77634/new/

https://reviews.llvm.org/D77634





More information about the llvm-commits mailing list