[flang] [llvm] [mlir] [MLIR][Flang][OpenMP] Make omp.simdloop into a loop wrapper (PR #87365)

Sergio Afonso via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 16 07:44:46 PDT 2024


================
@@ -498,6 +502,8 @@ struct OpWithBodyGenInfo {
   mlir::Location loc;
   /// [in] current PFT node/evaluation.
   Fortran::lower::pft::Evaluation &eval;
+  /// [in] kind of operation.
+  OpKind kind;
----------------
skatrak wrote:

> Why introduce a new enum and not reusing `llvm::omp::Directive`?

I agree there's not much point to adding that enum. I changed it to `llvm::omp::Directive` now.

> Note that LLVMFrontend defines helpers such as `isOpenMPParallelDirective` and `getDirectiveAssociation` to find out whether an `llvm::omp::Directives` involves a loop/parallel.

Thanks for the pointer to `getDirectiveAssociation`. I updated `createBodyOfOp` to use it. We don't need to use `isOpenMPParallelDirective` in this case, since the directive here should refer to a leaf construct, so we don't need to deal with compound ones.

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


More information about the llvm-commits mailing list