[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 26 04:18:35 PDT 2026


================
@@ -12226,6 +12226,12 @@ def err_omp_invalid_looprange
 def warn_omp_redundant_fusion : Warning<"looprange clause selects a single "
                                         "loop, resulting in redundant fusion">,
                                 InGroup<OpenMPClauses>;
+def warn_omp_flatten_omitted_depth : Warning<
+  "'flatten' without a 'depth' clause only combines 2 loops, but 3 or more "
+  "loops are perfectly nested">,
----------------
Meinersbur wrote:

cnsider also adding a fix-it note like `note_condition_assign_silence` that suggests to add `depth(2)` to the clause

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


More information about the cfe-commits mailing list