================ @@ -25,6 +25,43 @@ using namespace llvm::omp; #define GEN_DIRECTIVES_IMPL #include "llvm/Frontend/OpenMP/OMP.inc" +static iterator_range<ArrayRef<Directive>::iterator> +getFirstCompositeRange(iterator_range<ArrayRef<Directive>::iterator> Leafs) { ---------------- skatrak wrote:
My understanding is that there can only be at most a single composite construct when decomposing any given compound construct. So there wouldn't be a "first" composite range, but rather one composite range or none. In fact, if there is a composite range, it must also be at the end of the construct. So, something like this: `<composite-construct><other-leaf>` can't happen. Decomposing a single compound construct into a list of leaves while keeping composite constructs as a unit should be as simple as forwarding all block-associated leaves until finding a loop-associated leaf and then aggregating (via `getCompoundConstruct()`) everything from there until the end of the leaf list to append one composite or single loop construct. https://github.com/llvm/llvm-project/pull/89104 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits