@@ -499,18 +499,16 @@ class InnerLoopVectorizer {
499
499
public:
500
500
InnerLoopVectorizer (Loop *OrigLoop, PredicatedScalarEvolution &PSE,
501
501
LoopInfo *LI, DominatorTree *DT,
502
- const TargetLibraryInfo *TLI,
503
502
const TargetTransformInfo *TTI, AssumptionCache *AC,
504
- OptimizationRemarkEmitter *ORE, ElementCount VecWidth,
503
+ ElementCount VecWidth,
505
504
ElementCount MinProfitableTripCount,
506
505
unsigned UnrollFactor, LoopVectorizationCostModel *CM,
507
506
BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
508
507
GeneratedRTChecks &RTChecks, VPlan &Plan)
509
- : OrigLoop(OrigLoop), PSE(PSE), LI(LI), DT(DT), TLI(TLI), TTI(TTI),
510
- AC (AC), ORE(ORE), VF(VecWidth),
511
- MinProfitableTripCount(MinProfitableTripCount), UF(UnrollFactor),
512
- Builder(PSE.getSE()->getContext()), Cost(CM), BFI(BFI), PSI(PSI),
513
- RTChecks(RTChecks), Plan(Plan),
508
+ : OrigLoop(OrigLoop), PSE(PSE), LI(LI), DT(DT), TTI(TTI), AC(AC),
509
+ VF (VecWidth), MinProfitableTripCount(MinProfitableTripCount),
510
+ UF(UnrollFactor), Builder(PSE.getSE()->getContext()), Cost(CM),
511
+ BFI(BFI), PSI(PSI), RTChecks(RTChecks), Plan(Plan),
514
512
VectorPHVPBB(cast<VPBasicBlock>(
515
513
Plan.getVectorLoopRegion()->getSinglePredecessor())) {}
516
514
@@ -584,18 +582,12 @@ class InnerLoopVectorizer {
584
582
// / Dominator Tree.
585
583
DominatorTree *DT;
586
584
587
- // / Target Library Info.
588
- const TargetLibraryInfo *TLI;
589
-
590
585
// / Target Transform Info.
591
586
const TargetTransformInfo *TTI;
592
587
593
588
// / Assumption Cache.
594
589
AssumptionCache *AC;
595
590
596
- // / Interface to emit optimization remarks.
597
- OptimizationRemarkEmitter *ORE;
598
-
599
591
// / The vectorization SIMD factor to use. Each vector will have this many
600
592
// / vector elements.
601
593
ElementCount VF;
@@ -617,9 +609,6 @@ class InnerLoopVectorizer {
617
609
// / The scalar-loop preheader.
618
610
BasicBlock *LoopScalarPreHeader = nullptr ;
619
611
620
- // / Middle Block between the vector and the scalar.
621
- BasicBlock *LoopMiddleBlock = nullptr ;
622
-
623
612
// / Trip count of the original loop.
624
613
Value *TripCount = nullptr ;
625
614
@@ -684,14 +673,12 @@ class InnerLoopAndEpilogueVectorizer : public InnerLoopVectorizer {
684
673
public:
685
674
InnerLoopAndEpilogueVectorizer (
686
675
Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI,
687
- DominatorTree *DT, const TargetLibraryInfo *TLI,
688
- const TargetTransformInfo *TTI, AssumptionCache *AC,
689
- OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
690
- LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
691
- ProfileSummaryInfo *PSI, GeneratedRTChecks &Checks, VPlan &Plan,
692
- ElementCount VecWidth, ElementCount MinProfitableTripCount,
693
- unsigned UnrollFactor)
694
- : InnerLoopVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE, VecWidth,
676
+ DominatorTree *DT, const TargetTransformInfo *TTI, AssumptionCache *AC,
677
+ EpilogueLoopVectorizationInfo &EPI, LoopVectorizationCostModel *CM,
678
+ BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
679
+ GeneratedRTChecks &Checks, VPlan &Plan, ElementCount VecWidth,
680
+ ElementCount MinProfitableTripCount, unsigned UnrollFactor)
681
+ : InnerLoopVectorizer(OrigLoop, PSE, LI, DT, TTI, AC, VecWidth,
695
682
MinProfitableTripCount, UnrollFactor, CM, BFI, PSI,
696
683
Checks, Plan),
697
684
EPI (EPI) {}
@@ -721,16 +708,17 @@ class InnerLoopAndEpilogueVectorizer : public InnerLoopVectorizer {
721
708
// / epilogues.
722
709
class EpilogueVectorizerMainLoop : public InnerLoopAndEpilogueVectorizer {
723
710
public:
724
- EpilogueVectorizerMainLoop (
725
- Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI,
726
- DominatorTree *DT, const TargetLibraryInfo *TLI,
727
- const TargetTransformInfo *TTI, AssumptionCache *AC,
728
- OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
729
- LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
730
- ProfileSummaryInfo *PSI, GeneratedRTChecks &Check, VPlan &Plan)
731
- : InnerLoopAndEpilogueVectorizer(
732
- OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE, EPI, CM, BFI, PSI, Check,
733
- Plan, EPI.MainLoopVF, EPI.MainLoopVF, EPI.MainLoopUF) {}
711
+ EpilogueVectorizerMainLoop (Loop *OrigLoop, PredicatedScalarEvolution &PSE,
712
+ LoopInfo *LI, DominatorTree *DT,
713
+ const TargetTransformInfo *TTI,
714
+ AssumptionCache *AC,
715
+ EpilogueLoopVectorizationInfo &EPI,
716
+ LoopVectorizationCostModel *CM,
717
+ BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
718
+ GeneratedRTChecks &Check, VPlan &Plan)
719
+ : InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TTI, AC, EPI, CM,
720
+ BFI, PSI, Check, Plan, EPI.MainLoopVF,
721
+ EPI.MainLoopVF, EPI.MainLoopUF) {}
734
722
// / Implements the interface for creating a vectorized skeleton using the
735
723
// / *main loop* strategy (ie the first pass of vplan execution).
736
724
BasicBlock *createEpilogueVectorizedLoopSkeleton () final ;
@@ -751,14 +739,13 @@ class EpilogueVectorizerEpilogueLoop : public InnerLoopAndEpilogueVectorizer {
751
739
public:
752
740
EpilogueVectorizerEpilogueLoop (
753
741
Loop *OrigLoop, PredicatedScalarEvolution &PSE, LoopInfo *LI,
754
- DominatorTree *DT, const TargetLibraryInfo *TLI,
755
- const TargetTransformInfo *TTI, AssumptionCache *AC,
756
- OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
757
- LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
758
- ProfileSummaryInfo *PSI, GeneratedRTChecks &Checks, VPlan &Plan)
759
- : InnerLoopAndEpilogueVectorizer(
760
- OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE, EPI, CM, BFI, PSI, Checks,
761
- Plan, EPI.EpilogueVF, EPI.EpilogueVF, EPI.EpilogueUF) {
742
+ DominatorTree *DT, const TargetTransformInfo *TTI, AssumptionCache *AC,
743
+ EpilogueLoopVectorizationInfo &EPI, LoopVectorizationCostModel *CM,
744
+ BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
745
+ GeneratedRTChecks &Checks, VPlan &Plan)
746
+ : InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TTI, AC, EPI, CM,
747
+ BFI, PSI, Checks, Plan, EPI.EpilogueVF,
748
+ EPI.EpilogueVF, EPI.EpilogueUF) {
762
749
TripCount = EPI.TripCount ;
763
750
}
764
751
// / Implements the interface for creating a vectorized skeleton using the
@@ -9475,8 +9462,8 @@ static bool processLoopInVPlanNativePath(
9475
9462
9476
9463
{
9477
9464
GeneratedRTChecks Checks (PSE, DT, LI, TTI, F->getDataLayout (), CM.CostKind );
9478
- InnerLoopVectorizer LB (L, PSE, LI, DT, TLI, TTI, AC, ORE , VF.Width ,
9479
- VF. Width , 1 , &CM, BFI, PSI, Checks, BestPlan);
9465
+ InnerLoopVectorizer LB (L, PSE, LI, DT, TTI, AC, VF. Width , VF.Width , 1 , &CM ,
9466
+ BFI, PSI, Checks, BestPlan);
9480
9467
LLVM_DEBUG (dbgs () << " Vectorizing outer loop in \" "
9481
9468
<< L->getHeader ()->getParent ()->getName () << " \"\n " );
9482
9469
LVP.executePlan (VF.Width , 1 , BestPlan, LB, DT, false );
@@ -10258,7 +10245,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10258
10245
// interleave it.
10259
10246
VPlan &BestPlan = LVP.getPlanFor (VF.Width );
10260
10247
InnerLoopVectorizer Unroller (
10261
- L, PSE, LI, DT, TLI, TTI, AC, ORE , ElementCount::getFixed (1 ),
10248
+ L, PSE, LI, DT, TTI, AC, ElementCount::getFixed (1 ),
10262
10249
ElementCount::getFixed (1 ), IC, &CM, BFI, PSI, Checks, BestPlan);
10263
10250
10264
10251
// TODO: Move to general VPlan pipeline once epilogue loops are also
@@ -10293,18 +10280,16 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10293
10280
preparePlanForMainVectorLoop (*BestMainPlan, BestEpiPlan);
10294
10281
EpilogueLoopVectorizationInfo EPI (VF.Width , IC, EpilogueVF.Width , 1 ,
10295
10282
BestEpiPlan);
10296
- EpilogueVectorizerMainLoop MainILV (L, PSE, LI, DT, TLI, TTI, AC, ORE,
10297
- EPI, &CM, BFI, PSI, Checks,
10298
- *BestMainPlan);
10283
+ EpilogueVectorizerMainLoop MainILV (L, PSE, LI, DT, TTI, AC, EPI, &CM,
10284
+ BFI, PSI, Checks, *BestMainPlan);
10299
10285
auto ExpandedSCEVs = LVP.executePlan (EPI.MainLoopVF , EPI.MainLoopUF ,
10300
10286
*BestMainPlan, MainILV, DT, false );
10301
10287
++LoopsVectorized;
10302
10288
10303
10289
// Second pass vectorizes the epilogue and adjusts the control flow
10304
10290
// edges from the first pass.
10305
- EpilogueVectorizerEpilogueLoop EpilogILV (L, PSE, LI, DT, TLI, TTI, AC,
10306
- ORE, EPI, &CM, BFI, PSI,
10307
- Checks, BestEpiPlan);
10291
+ EpilogueVectorizerEpilogueLoop EpilogILV (
10292
+ L, PSE, LI, DT, TTI, AC, EPI, &CM, BFI, PSI, Checks, BestEpiPlan);
10308
10293
EpilogILV.setTripCount (MainILV.getTripCount ());
10309
10294
preparePlanForEpilogueVectorLoop (BestEpiPlan, L, ExpandedSCEVs, EPI);
10310
10295
@@ -10329,7 +10314,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
10329
10314
if (!Checks.hasChecks ())
10330
10315
DisableRuntimeUnroll = true ;
10331
10316
} else {
10332
- InnerLoopVectorizer LB (L, PSE, LI, DT, TLI, TTI, AC, ORE , VF.Width ,
10317
+ InnerLoopVectorizer LB (L, PSE, LI, DT, TTI, AC, VF.Width ,
10333
10318
VF.MinProfitableTripCount , IC, &CM, BFI, PSI,
10334
10319
Checks, BestPlan);
10335
10320
// TODO: Move to general VPlan pipeline once epilogue loops are also
0 commit comments