@@ -646,9 +646,8 @@ class InnerLoopVectorizer {
646
646
647
647
// / Complete the loop skeleton by adding debug MDs, creating appropriate
648
648
// / conditional branches in the middle block, preparing the builder and
649
- // / running the verifier. Take in the vector loop \p L as argument, and return
650
- // / the preheader of the completed vector loop.
651
- BasicBlock *completeLoopSkeleton (Loop *L, MDNode *OrigLoopID);
649
+ // / running the verifier. Return the preheader of the completed vector loop.
650
+ BasicBlock *completeLoopSkeleton (MDNode *OrigLoopID);
652
651
653
652
// / Add additional metadata to \p To that was not present on \p Orig.
654
653
// /
@@ -3234,13 +3233,10 @@ void InnerLoopVectorizer::createInductionResumeValues(
3234
3233
}
3235
3234
}
3236
3235
3237
- BasicBlock *InnerLoopVectorizer::completeLoopSkeleton (Loop *L,
3238
- MDNode *OrigLoopID) {
3239
- assert (L && " Expected valid loop." );
3240
-
3236
+ BasicBlock *InnerLoopVectorizer::completeLoopSkeleton (MDNode *OrigLoopID) {
3241
3237
// The trip counts should be cached by now.
3242
- Value *Count = getOrCreateTripCount (L-> getLoopPreheader () );
3243
- Value *VectorTripCount = getOrCreateVectorTripCount (L-> getLoopPreheader () );
3238
+ Value *Count = getOrCreateTripCount (LoopVectorPreHeader );
3239
+ Value *VectorTripCount = getOrCreateVectorTripCount (LoopVectorPreHeader );
3244
3240
3245
3241
auto *ScalarLatchTerm = OrigLoop->getLoopLatch ()->getTerminator ();
3246
3242
@@ -3265,10 +3261,6 @@ BasicBlock *InnerLoopVectorizer::completeLoopSkeleton(Loop *L,
3265
3261
cast<BranchInst>(LoopMiddleBlock->getTerminator ())->setCondition (CmpN);
3266
3262
}
3267
3263
3268
- // Get ready to start creating new instructions into the vectorized body.
3269
- assert (LoopVectorPreHeader == L->getLoopPreheader () &&
3270
- " Inconsistent vector loop preheader" );
3271
-
3272
3264
#ifdef EXPENSIVE_CHECKS
3273
3265
assert (DT->verify (DominatorTree::VerificationLevel::Fast));
3274
3266
LI->verify (*DT);
@@ -3348,7 +3340,7 @@ InnerLoopVectorizer::createVectorizedLoopSkeleton() {
3348
3340
// Emit phis for the new starting index of the scalar loop.
3349
3341
createInductionResumeValues (Lp);
3350
3342
3351
- return {completeLoopSkeleton (Lp, OrigLoopID), nullptr };
3343
+ return {completeLoopSkeleton (OrigLoopID), nullptr };
3352
3344
}
3353
3345
3354
3346
// Fix up external users of the induction variable. At this point, we are
@@ -7897,7 +7889,7 @@ EpilogueVectorizerMainLoop::createEpilogueVectorizedLoopSkeleton() {
7897
7889
// because the vplan in the second pass still contains the inductions from the
7898
7890
// original loop.
7899
7891
7900
- return {completeLoopSkeleton (Lp, OrigLoopID), nullptr };
7892
+ return {completeLoopSkeleton (OrigLoopID), nullptr };
7901
7893
}
7902
7894
7903
7895
void EpilogueVectorizerMainLoop::printDebugTracesAtStart () {
@@ -8076,7 +8068,7 @@ EpilogueVectorizerEpilogueLoop::createEpilogueVectorizedLoopSkeleton() {
8076
8068
createInductionResumeValues (Lp, {VecEpilogueIterationCountCheck,
8077
8069
EPI.VectorTripCount } /* AdditionalBypass */ );
8078
8070
8079
- return {completeLoopSkeleton (Lp, OrigLoopID), EPResumeVal};
8071
+ return {completeLoopSkeleton (OrigLoopID), EPResumeVal};
8080
8072
}
8081
8073
8082
8074
BasicBlock *
0 commit comments