[llvm] r223847 - Remove redundant variable.

Michael Zolotukhin mzolotukhin at apple.com
Tue Dec 9 14:45:07 PST 2014


Author: mzolotukhin
Date: Tue Dec  9 16:45:07 2014
New Revision: 223847

URL: http://llvm.org/viewvc/llvm-project?rev=223847&view=rev
Log:
Remove redundant variable.

Tested by adding assert(LoopVectorPreHeader == VecPreheader) on LLVM
test suite and SPECs.

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=223847&r1=223846&r2=223847&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Tue Dec  9 16:45:07 2014
@@ -2833,9 +2833,6 @@ void InnerLoopVectorizer::vectorizeLoop(
     }
 
     // Fix the vector-loop phi.
-    // We created the induction variable so we know that the
-    // preheader is the first entry.
-    BasicBlock *VecPreheader = Induction->getIncomingBlock(0);
 
     // Reductions do not have to start at zero. They can start with
     // any loop invariant values.
@@ -2847,7 +2844,8 @@ void InnerLoopVectorizer::vectorizeLoop(
       // Make sure to add the reduction stat value only to the
       // first unroll part.
       Value *StartVal = (part == 0) ? VectorStart : Identity;
-      cast<PHINode>(VecRdxPhi[part])->addIncoming(StartVal, VecPreheader);
+      cast<PHINode>(VecRdxPhi[part])->addIncoming(StartVal,
+                                                  LoopVectorPreHeader);
       cast<PHINode>(VecRdxPhi[part])->addIncoming(Val[part],
                                                   LoopVectorBody.back());
     }





More information about the llvm-commits mailing list