@@ -482,15 +482,14 @@ class InnerLoopVectorizer {
482
482
const TargetTransformInfo *TTI, AssumptionCache *AC,
483
483
OptimizationRemarkEmitter *ORE, ElementCount VecWidth,
484
484
ElementCount MinProfitableTripCount,
485
- unsigned UnrollFactor, LoopVectorizationLegality *LVL,
486
- LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
487
- ProfileSummaryInfo *PSI, GeneratedRTChecks &RTChecks,
488
- VPlan &Plan)
485
+ unsigned UnrollFactor, LoopVectorizationCostModel *CM,
486
+ BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
487
+ GeneratedRTChecks &RTChecks, VPlan &Plan)
489
488
: OrigLoop(OrigLoop), PSE(PSE), LI(LI), DT(DT), TLI(TLI), TTI(TTI),
490
489
AC (AC), ORE(ORE), VF(VecWidth),
491
490
MinProfitableTripCount(MinProfitableTripCount), UF(UnrollFactor),
492
- Builder(PSE.getSE()->getContext()), Legal(LVL), Cost(CM), BFI(BFI),
493
- PSI(PSI), RTChecks(RTChecks), Plan(Plan),
491
+ Builder(PSE.getSE()->getContext()), Cost(CM), BFI(BFI), PSI(PSI ),
492
+ RTChecks(RTChecks), Plan(Plan),
494
493
VectorPHVPB(Plan.getEntry()->getSingleSuccessor()) {}
495
494
496
495
virtual ~InnerLoopVectorizer () = default ;
@@ -630,9 +629,6 @@ class InnerLoopVectorizer {
630
629
// / Trip count of the widened loop (TripCount - TripCount % (VF*UF))
631
630
Value *VectorTripCount = nullptr ;
632
631
633
- // / The legality analysis.
634
- LoopVectorizationLegality *Legal;
635
-
636
632
// / The profitablity analysis.
637
633
LoopVectorizationCostModel *Cost;
638
634
@@ -699,12 +695,11 @@ class InnerLoopAndEpilogueVectorizer : public InnerLoopVectorizer {
699
695
DominatorTree *DT, const TargetLibraryInfo *TLI,
700
696
const TargetTransformInfo *TTI, AssumptionCache *AC,
701
697
OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
702
- LoopVectorizationLegality *LVL, llvm::LoopVectorizationCostModel *CM,
703
- BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
704
- GeneratedRTChecks &Checks, VPlan &Plan)
698
+ LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
699
+ ProfileSummaryInfo *PSI, GeneratedRTChecks &Checks, VPlan &Plan)
705
700
: InnerLoopVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE,
706
- EPI.MainLoopVF, EPI.MainLoopVF, EPI.MainLoopUF, LVL ,
707
- CM, BFI, PSI, Checks, Plan),
701
+ EPI.MainLoopVF, EPI.MainLoopVF, EPI.MainLoopUF, CM ,
702
+ BFI, PSI, Checks, Plan),
708
703
EPI (EPI) {}
709
704
710
705
// Override this function to handle the more complex control flow around the
@@ -737,11 +732,10 @@ class EpilogueVectorizerMainLoop : public InnerLoopAndEpilogueVectorizer {
737
732
DominatorTree *DT, const TargetLibraryInfo *TLI,
738
733
const TargetTransformInfo *TTI, AssumptionCache *AC,
739
734
OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
740
- LoopVectorizationLegality *LVL, llvm::LoopVectorizationCostModel *CM,
741
- BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
742
- GeneratedRTChecks &Check, VPlan &Plan)
735
+ LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
736
+ ProfileSummaryInfo *PSI, GeneratedRTChecks &Check, VPlan &Plan)
743
737
: InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE,
744
- EPI, LVL, CM, BFI, PSI, Check, Plan) {}
738
+ EPI, CM, BFI, PSI, Check, Plan) {}
745
739
// / Implements the interface for creating a vectorized skeleton using the
746
740
// / *main loop* strategy (ie the first pass of vplan execution).
747
741
BasicBlock *createEpilogueVectorizedLoopSkeleton () final ;
@@ -765,11 +759,10 @@ class EpilogueVectorizerEpilogueLoop : public InnerLoopAndEpilogueVectorizer {
765
759
DominatorTree *DT, const TargetLibraryInfo *TLI,
766
760
const TargetTransformInfo *TTI, AssumptionCache *AC,
767
761
OptimizationRemarkEmitter *ORE, EpilogueLoopVectorizationInfo &EPI,
768
- LoopVectorizationLegality *LVL, llvm::LoopVectorizationCostModel *CM,
769
- BlockFrequencyInfo *BFI, ProfileSummaryInfo *PSI,
770
- GeneratedRTChecks &Checks, VPlan &Plan)
762
+ LoopVectorizationCostModel *CM, BlockFrequencyInfo *BFI,
763
+ ProfileSummaryInfo *PSI, GeneratedRTChecks &Checks, VPlan &Plan)
771
764
: InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE,
772
- EPI, LVL, CM, BFI, PSI, Checks, Plan) {
765
+ EPI, CM, BFI, PSI, Checks, Plan) {
773
766
TripCount = EPI.TripCount ;
774
767
}
775
768
// / Implements the interface for creating a vectorized skeleton using the
@@ -7902,7 +7895,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
7902
7895
7903
7896
// Only use noalias metadata when using memory checks guaranteeing no overlap
7904
7897
// across all iterations.
7905
- const LoopAccessInfo *LAI = ILV. Legal ->getLAI ();
7898
+ const LoopAccessInfo *LAI = Legal->getLAI ();
7906
7899
std::unique_ptr<LoopVersioning> LVer = nullptr ;
7907
7900
if (LAI && !LAI->getRuntimePointerChecking ()->getChecks ().empty () &&
7908
7901
!LAI->getRuntimePointerChecking ()->getDiffChecks ()) {
@@ -10254,7 +10247,7 @@ static bool processLoopInVPlanNativePath(
10254
10247
GeneratedRTChecks Checks (PSE, DT, LI, TTI, F->getDataLayout (),
10255
10248
AddBranchWeights, CM.CostKind );
10256
10249
InnerLoopVectorizer LB (L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width ,
10257
- VF.Width , 1 , LVL, &CM, BFI, PSI, Checks, BestPlan);
10250
+ VF.Width , 1 , &CM, BFI, PSI, Checks, BestPlan);
10258
10251
LLVM_DEBUG (dbgs () << " Vectorizing outer loop in \" "
10259
10252
<< L->getHeader ()->getParent ()->getName () << " \"\n " );
10260
10253
LVP.executePlan (VF.Width , 1 , BestPlan, LB, DT, false );
@@ -11022,7 +11015,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
11022
11015
VPlan &BestPlan = LVP.getPlanFor (VF.Width );
11023
11016
InnerLoopVectorizer Unroller (
11024
11017
L, PSE, LI, DT, TLI, TTI, AC, ORE, ElementCount::getFixed (1 ),
11025
- ElementCount::getFixed (1 ), IC, &LVL, & CM, BFI, PSI, Checks, BestPlan);
11018
+ ElementCount::getFixed (1 ), IC, &CM, BFI, PSI, Checks, BestPlan);
11026
11019
11027
11020
LVP.executePlan (VF.Width , IC, BestPlan, Unroller, DT, false );
11028
11021
@@ -11051,7 +11044,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
11051
11044
EpilogueLoopVectorizationInfo EPI (VF.Width , IC, EpilogueVF.Width , 1 ,
11052
11045
BestEpiPlan);
11053
11046
EpilogueVectorizerMainLoop MainILV (L, PSE, LI, DT, TLI, TTI, AC, ORE,
11054
- EPI, &LVL, & CM, BFI, PSI, Checks,
11047
+ EPI, &CM, BFI, PSI, Checks,
11055
11048
*BestMainPlan);
11056
11049
auto ExpandedSCEVs = LVP.executePlan (EPI.MainLoopVF , EPI.MainLoopUF ,
11057
11050
*BestMainPlan, MainILV, DT, false );
@@ -11062,7 +11055,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
11062
11055
EPI.MainLoopVF = EPI.EpilogueVF ;
11063
11056
EPI.MainLoopUF = EPI.EpilogueUF ;
11064
11057
EpilogueVectorizerEpilogueLoop EpilogILV (L, PSE, LI, DT, TLI, TTI, AC,
11065
- ORE, EPI, &LVL, & CM, BFI, PSI,
11058
+ ORE, EPI, &CM, BFI, PSI,
11066
11059
Checks, BestEpiPlan);
11067
11060
EpilogILV.setTripCount (MainILV.getTripCount ());
11068
11061
preparePlanForEpilogueVectorLoop (BestEpiPlan, L, ExpandedSCEVs, EPI);
@@ -11089,8 +11082,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
11089
11082
DisableRuntimeUnroll = true ;
11090
11083
} else {
11091
11084
InnerLoopVectorizer LB (L, PSE, LI, DT, TLI, TTI, AC, ORE, VF.Width ,
11092
- VF.MinProfitableTripCount , IC, &LVL, & CM, BFI,
11093
- PSI, Checks, BestPlan);
11085
+ VF.MinProfitableTripCount , IC, &CM, BFI, PSI ,
11086
+ Checks, BestPlan);
11094
11087
LVP.executePlan (VF.Width , IC, BestPlan, LB, DT, false );
11095
11088
++LoopsVectorized;
11096
11089
0 commit comments