[llvm-branch-commits] [flang] [Flang][OpenMP][Lower] Refactor lowering of compound constructs (PR #87070)

Krzysztof Parzyszek via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Mar 29 07:50:23 PDT 2024


================
@@ -710,6 +710,81 @@ genOpenMPReduction(Fortran::lower::AbstractConverter &converter,
   }
 }
 
+/// Split a combined directive into an outer leaf directive and the (possibly
+/// combined) rest of the combined directive. Composite directives and
+/// non-compound directives are not split, in which case it will return the
+/// input directive as its first output and an empty value as its second output.
+static std::pair<llvm::omp::Directive, std::optional<llvm::omp::Directive>>
----------------
kparzysz wrote:

We have llvm::omp::getLeafConstructs that breaks up any combined/composite directive into leafs.

I have functions `is[Leaf|Combined|Composite]Construct` in a local commit, I can make a PR for it.

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


More information about the llvm-branch-commits mailing list