[PATCH] D23410: [SLP] Initialize VectorizedValue when gathering

Michael Kuperstein via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 15 14:51:51 PDT 2016


mkuper added inline comments.

================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:2175
@@ +2174,3 @@
+  auto ForwardStart = BasicBlock::iterator(Leader);
+  for (auto &I : make_range(ForwardStart, BB->end())) {
+    if (Bundle.erase(&I))
----------------
Just to make sure I understand this correctly - you're running from Leader, inclusive, so that if VL[0] is the last instruction in program order, you'll end up with LastInst == Leader, right?
If so, it's probably worth a comment - or just initialize LastInst to Leader instead of null.

Also, won't we get worst-case quardatic behavior here, if VL[0] is consistently last (so we end up running to the end of the block for each bundle)?


https://reviews.llvm.org/D23410





More information about the llvm-commits mailing list