[clang] [openmp] [Clang][OpenMP] Guard Inner flatten inits on enclosing loop trip counts (PR #237907)

Amit Tiwari via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 23:27:57 PST 2026


================
@@ -17580,12 +17580,24 @@ SemaOpenMP::ActOnOpenMPFlattenDirective(ArrayRef<OMPClause *> Clauses,
 
   // Collect pre-init statements in outer-to-inner order.
   SmallVector<Stmt *> PreInits;
+  SmallVector<SmallVector<Stmt *, 2>, 4> GatedInits(NumLoops);
----------------
loopacino wrote:

Used `1` instead of `0`. For this list, a non-empty case is almost always a single assignment.

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


More information about the cfe-commits mailing list