[LV] Move some code around slightly to make the intent of the function more clear.
authorJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:32 +0000 (10:15 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 2 Sep 2015 10:15:32 +0000 (10:15 +0000)
NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246636 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Vectorize/LoopVectorize.cpp

index 6d4a134aa670ca9e67e8e16e86644b8d622211aa..0975b03da173217ee7ac4a417c3d9df60aa67a5a 100644 (file)
@@ -2870,12 +2870,10 @@ void InnerLoopVectorizer::createEmptyLoop() {
   // faster.
   emitMemRuntimeChecks(Lp, MiddleBlock);
 
-  // Add the start index to the loop count to get the new end index.
-  Value *CountRoundDown = getOrCreateVectorTripCount(Lp);
-
   // Generate the induction variable.
   // The loop step is equal to the vectorization factor (num of SIMD elements)
   // times the unroll factor (num of SIMD instructions).
+  Value *CountRoundDown = getOrCreateVectorTripCount(Lp);
   Constant *Step = ConstantInt::get(IdxTy, VF * UF);
   Induction =
     createInductionVariable(Lp, StartIdx, CountRoundDown, Step,