[PATCH] D34768: Remove creation of vector to store loop indices

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 16:16:29 PDT 2017


efriedma added inline comments.


================
Comment at: lib/Transforms/Scalar/LoopIdiomRecognize.cpp:605
+
+      it += delta;
+
----------------
This arithmetic is hard to follow... which is why it was written with the vector in the first place.

If you're really unhappy with memory allocation, maybe try using iterators?  Something like `auto SLRef = makeArrayRef(SL); for (StoreInst *k : concat(SLRef.slice(i+1), reverse(SLRef.slice(0, i - 1))))`


https://reviews.llvm.org/D34768





More information about the llvm-commits mailing list