Skip to content

Commit 2e93417

Browse files
committed
[LV] Remove LoopVectorizationLegality from InnerLoopVectorizer (NFC).
a51e282 removed the last real use of Legal in InnerLoopVectorizer. Now that it isn't used any longer, remove it to avoid new users being introduced.
1 parent 72bc052 commit 2e93417

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -482,15 +482,14 @@ class InnerLoopVectorizer {
482482
const TargetTransformInfo *TTI, AssumptionCache *AC,
483483
OptimizationRemarkEmitter *ORE, ElementCount VecWidth,
484484
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)
489488
: OrigLoop(OrigLoop), PSE(PSE), LI(LI), DT(DT), TLI(TLI), TTI(TTI),
490489
AC(AC), ORE(ORE), VF(VecWidth),
491490
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),
494493
VectorPHVPB(Plan.getEntry()->getSingleSuccessor()) {}
495494

496495
virtual ~InnerLoopVectorizer() = default;
@@ -630,9 +629,6 @@ class InnerLoopVectorizer {
630629
/// Trip count of the widened loop (TripCount - TripCount % (VF*UF))
631630
Value *VectorTripCount = nullptr;
632631

633-
/// The legality analysis.
634-
LoopVectorizationLegality *Legal;
635-
636632
/// The profitablity analysis.
637633
LoopVectorizationCostModel *Cost;
638634

@@ -699,12 +695,11 @@ class InnerLoopAndEpilogueVectorizer : public InnerLoopVectorizer {
699695
DominatorTree *DT, const TargetLibraryInfo *TLI,
700696
const TargetTransformInfo *TTI, AssumptionCache *AC,
701697
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)
705700
: 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),
708703
EPI(EPI) {}
709704

710705
// Override this function to handle the more complex control flow around the
@@ -737,11 +732,10 @@ class EpilogueVectorizerMainLoop : public InnerLoopAndEpilogueVectorizer {
737732
DominatorTree *DT, const TargetLibraryInfo *TLI,
738733
const TargetTransformInfo *TTI, AssumptionCache *AC,
739734
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)
743737
: InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE,
744-
EPI, LVL, CM, BFI, PSI, Check, Plan) {}
738+
EPI, CM, BFI, PSI, Check, Plan) {}
745739
/// Implements the interface for creating a vectorized skeleton using the
746740
/// *main loop* strategy (ie the first pass of vplan execution).
747741
BasicBlock *createEpilogueVectorizedLoopSkeleton() final;
@@ -765,11 +759,10 @@ class EpilogueVectorizerEpilogueLoop : public InnerLoopAndEpilogueVectorizer {
765759
DominatorTree *DT, const TargetLibraryInfo *TLI,
766760
const TargetTransformInfo *TTI, AssumptionCache *AC,
767761
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)
771764
: InnerLoopAndEpilogueVectorizer(OrigLoop, PSE, LI, DT, TLI, TTI, AC, ORE,
772-
EPI, LVL, CM, BFI, PSI, Checks, Plan) {
765+
EPI, CM, BFI, PSI, Checks, Plan) {
773766
TripCount = EPI.TripCount;
774767
}
775768
/// Implements the interface for creating a vectorized skeleton using the
@@ -7902,7 +7895,7 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
79027895

79037896
// Only use noalias metadata when using memory checks guaranteeing no overlap
79047897
// across all iterations.
7905-
const LoopAccessInfo *LAI = ILV.Legal->getLAI();
7898+
const LoopAccessInfo *LAI = Legal->getLAI();
79067899
std::unique_ptr<LoopVersioning> LVer = nullptr;
79077900
if (LAI && !LAI->getRuntimePointerChecking()->getChecks().empty() &&
79087901
!LAI->getRuntimePointerChecking()->getDiffChecks()) {
@@ -10254,7 +10247,7 @@ static bool processLoopInVPlanNativePath(
1025410247
GeneratedRTChecks Checks(PSE, DT, LI, TTI, F->getDataLayout(),
1025510248
AddBranchWeights, CM.CostKind);
1025610249
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);
1025810251
LLVM_DEBUG(dbgs() << "Vectorizing outer loop in \""
1025910252
<< L->getHeader()->getParent()->getName() << "\"\n");
1026010253
LVP.executePlan(VF.Width, 1, BestPlan, LB, DT, false);
@@ -11022,7 +11015,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1102211015
VPlan &BestPlan = LVP.getPlanFor(VF.Width);
1102311016
InnerLoopVectorizer Unroller(
1102411017
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);
1102611019

1102711020
LVP.executePlan(VF.Width, IC, BestPlan, Unroller, DT, false);
1102811021

@@ -11051,7 +11044,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1105111044
EpilogueLoopVectorizationInfo EPI(VF.Width, IC, EpilogueVF.Width, 1,
1105211045
BestEpiPlan);
1105311046
EpilogueVectorizerMainLoop MainILV(L, PSE, LI, DT, TLI, TTI, AC, ORE,
11054-
EPI, &LVL, &CM, BFI, PSI, Checks,
11047+
EPI, &CM, BFI, PSI, Checks,
1105511048
*BestMainPlan);
1105611049
auto ExpandedSCEVs = LVP.executePlan(EPI.MainLoopVF, EPI.MainLoopUF,
1105711050
*BestMainPlan, MainILV, DT, false);
@@ -11062,7 +11055,7 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1106211055
EPI.MainLoopVF = EPI.EpilogueVF;
1106311056
EPI.MainLoopUF = EPI.EpilogueUF;
1106411057
EpilogueVectorizerEpilogueLoop EpilogILV(L, PSE, LI, DT, TLI, TTI, AC,
11065-
ORE, EPI, &LVL, &CM, BFI, PSI,
11058+
ORE, EPI, &CM, BFI, PSI,
1106611059
Checks, BestEpiPlan);
1106711060
EpilogILV.setTripCount(MainILV.getTripCount());
1106811061
preparePlanForEpilogueVectorLoop(BestEpiPlan, L, ExpandedSCEVs, EPI);
@@ -11089,8 +11082,8 @@ bool LoopVectorizePass::processLoop(Loop *L) {
1108911082
DisableRuntimeUnroll = true;
1109011083
} else {
1109111084
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);
1109411087
LVP.executePlan(VF.Width, IC, BestPlan, LB, DT, false);
1109511088
++LoopsVectorized;
1109611089

0 commit comments

Comments
 (0)