[llvm] r241740 - [LoopVectorizer] Remove redundant variables PastOverflowCheck and OverflowCheckAnchor. NFCI.

Michael Zolotukhin mzolotukhin at apple.com
Wed Jul 8 14:47:56 PDT 2015


Author: mzolotukhin
Date: Wed Jul  8 16:47:56 2015
New Revision: 241740

URL: http://llvm.org/viewvc/llvm-project?rev=241740&view=rev
Log:
[LoopVectorizer] Remove redundant variables PastOverflowCheck and OverflowCheckAnchor. NFCI.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=241740&r1=241739&r2=241740&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed Jul  8 16:47:56 2015
@@ -2564,14 +2564,6 @@ void InnerLoopVectorizer::createEmptyLoo
                        IdxTy):
     ConstantInt::get(IdxTy, 0);
 
-  // We need an instruction to anchor the overflow check on. StartIdx needs to
-  // be defined before the overflow check branch. Because the scalar preheader
-  // is going to merge the start index and so the overflow branch block needs to
-  // contain a definition of the start index.
-  Instruction *OverflowCheckAnchor = BinaryOperator::CreateAdd(
-      StartIdx, ConstantInt::get(IdxTy, 0), "overflow.check.anchor",
-      BypassBlock->getTerminator());
-
   // Count holds the overall loop count (N).
   Value *Count = Exp.expandCodeFor(ExitCount, ExitCount->getType(),
                                    BypassBlock->getTerminator());
@@ -2617,9 +2609,8 @@ void InnerLoopVectorizer::createEmptyLoo
 
   // Generate code to check that the loop's trip count that we computed by
   // adding one to the backedge-taken count will not overflow.
-  auto PastOverflowCheck = std::next(BasicBlock::iterator(OverflowCheckAnchor));
-  BasicBlock *CheckBlock =
-      BypassBlock->splitBasicBlock(PastOverflowCheck, "overflow.checked");
+  BasicBlock *CheckBlock = BypassBlock->splitBasicBlock(
+      BypassBlock->getTerminator(), "overflow.checked");
   if (ParentLoop)
     ParentLoop->addBasicBlockToLoop(CheckBlock, *LI);
   LoopBypassBlocks.push_back(CheckBlock);





More information about the llvm-commits mailing list