[clang] [llvm] [openmp] [Clang][OpenMP] Add `#pragma omp flatten` loop directive + `depth` clause (PR #206977)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 12 03:28:48 PDT 2026


================
@@ -16382,6 +16395,277 @@ StmtResult SemaOpenMP::ActOnOpenMPInterchangeDirective(
                                          buildPreInits(Context, PreInits));
 }
 
+/// Counts the perfectly nested canonical loop depth at \p AStmt. Returns
+/// std::nullopt if a loop-generating transformation prevents a static count.
+static std::optional<unsigned> getCanonicalLoopNestDepth(Stmt *AStmt) {
----------------
Meinersbur wrote:

Please try to use existing functions. If you cannot adapt `doForAllLoops`, at least use `OMPLoopBasedDirective::tryToFindNextInnerLoop`.

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


More information about the cfe-commits mailing list