[llvm] r228056 - [LV] Split off memcheck block really at the first check

Adam Nemet anemet at apple.com
Tue Feb 3 14:45:40 PST 2015

Author: anemet
Date: Tue Feb  3 16:45:39 2015
New Revision: 228056

URL: http://llvm.org/viewvc/llvm-project?rev=228056&view=rev
[LV] Split off memcheck block really at the first check

I've noticed this while trying to move addRuntimeCheck to LoopAccessAnalysis.

I think that the intention was to early exit from the overflow checking before
the code for the memchecks.  This is the entire reason why we compute
FirstCheckInst but then we don't use that as the splitting instruction but the
final check.  Looks like an oversight.


Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=228056&r1=228055&r2=228056&view=diff
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Feb  3 16:45:39 2015
@@ -2333,7 +2333,7 @@ void InnerLoopVectorizer::createEmptyLoo
   if (MemRuntimeCheck) {
     // Create a new block containing the memory check.
     BasicBlock *CheckBlock =
-        LastBypassBlock->splitBasicBlock(MemRuntimeCheck, "vector.memcheck");
+        LastBypassBlock->splitBasicBlock(FirstCheckInst, "vector.memcheck");
     if (ParentLoop)
       ParentLoop->addBasicBlockToLoop(CheckBlock, *LI);

More information about the llvm-commits mailing list