================
@@ -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);
----------------
Meinersbur wrote:

```suggestion
  SmallVector<SmallVector<Stmt *, 0>, 4> GatedInits(NumLoops);
```
[nit] SmallVector inside other contrainers are problematic, they use space no 
matter how many items they store. A small size of `1` would also be fine if we 
know that there are few empty lists. `2` seems unmotivated for the cost it 
brings. Consider that the critical case is not when `GatedInits` itself is 
small and it finishes quickly anyway, but when it becomes really big (memory 
constraints). Not that I expect that in this case, but generally to keep in 
mind.

https://github.com/llvm/llvm-project/pull/237907
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to