[PATCH] D74658: [mlir][NFC] Fix 'gatherLoops' utility

Diego Caballero via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 15:29:40 PST 2020


dcaballe marked an inline comment as done.
dcaballe added inline comments.


================
Comment at: mlir/test/lib/Transforms/TestAffineDataCopy.cpp:46
   // Gather all AffineForOps by loop depth.
-  DenseMap<unsigned, SmallVector<AffineForOp, 2>> depthToLoops;
+  SmallVector<SmallVector<AffineForOp, 2>, 8> depthToLoops;
   gatherLoops(getFunction(), depthToLoops);
----------------
andydavis1 wrote:
> Typically we don't see SmallVector<SmallVector.  These patterns are typically std::vector<SmallVector.
Thanks Andy! I'll change that before committing. For my understanding, I'm not sure I follow the rationale. Isn't this one of the ideal cases for SmallVector? I.e., the object to be contained has a "large" memory footprint (a SmallVector with two op elements, in this case) and we want to avoid allocating unnecessary slots?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74658/new/

https://reviews.llvm.org/D74658





More information about the llvm-commits mailing list