Skip to content

Commit 5e9166e

Browse files
committed
[SLP] Remove TTI parameter from vectorizeHorReduction and vectorizeRootInstruction. NFC.
Since TTI is a member variable.
1 parent 6ffd3bb commit 5e9166e

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,13 @@ struct SLPVectorizerPass : public PassInfoMixin<SLPVectorizerPass> {
122122
/// or a horizontal reduction was not matched or not possible.
123123
bool vectorizeHorReduction(PHINode *P, Instruction *Root, BasicBlock *BB,
124124
slpvectorizer::BoUpSLP &R,
125-
TargetTransformInfo *TTI,
126125
SmallVectorImpl<WeakTrackingVH> &PostponedInsts);
127126

128127
/// Make an attempt to vectorize reduction and then try to vectorize
129128
/// postponed binary operations.
130129
/// \returns true on any successfull vectorization.
131130
bool vectorizeRootInstruction(PHINode *P, Instruction *Root, BasicBlock *BB,
132-
slpvectorizer::BoUpSLP &R,
133-
TargetTransformInfo *TTI);
131+
slpvectorizer::BoUpSLP &R);
134132

135133
/// Try to vectorize trees that start at insertvalue instructions.
136134
bool vectorizeInsertValueInst(InsertValueInst *IVI, BasicBlock *BB,

llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19949,7 +19949,7 @@ static bool isReductionCandidate(Instruction *I) {
1994919949
}
1995019950

1995119951
bool SLPVectorizerPass::vectorizeHorReduction(
19952-
PHINode *P, Instruction *Root, BasicBlock *BB, BoUpSLP &R, TargetTransformInfo *TTI,
19952+
PHINode *P, Instruction *Root, BasicBlock *BB, BoUpSLP &R,
1995319953
SmallVectorImpl<WeakTrackingVH> &PostponedInsts) {
1995419954
if (!ShouldVectorizeHor)
1995519955
return false;
@@ -19982,7 +19982,7 @@ bool SLPVectorizerPass::vectorizeHorReduction(
1998219982
Stack.emplace(SelectRoot(), 0);
1998319983
SmallPtrSet<Value *, 8> VisitedInstrs;
1998419984
bool Res = false;
19985-
auto &&TryToReduce = [this, TTI, &R](Instruction *Inst) -> Value * {
19985+
auto &&TryToReduce = [this, &R](Instruction *Inst) -> Value * {
1998619986
if (R.isAnalyzedReductionRoot(Inst))
1998719987
return nullptr;
1998819988
if (!isReductionCandidate(Inst))
@@ -20049,10 +20049,9 @@ bool SLPVectorizerPass::vectorizeHorReduction(
2004920049
}
2005020050

2005120051
bool SLPVectorizerPass::vectorizeRootInstruction(PHINode *P, Instruction *Root,
20052-
BasicBlock *BB, BoUpSLP &R,
20053-
TargetTransformInfo *TTI) {
20052+
BasicBlock *BB, BoUpSLP &R) {
2005420053
SmallVector<WeakTrackingVH> PostponedInsts;
20055-
bool Res = vectorizeHorReduction(P, Root, BB, R, TTI, PostponedInsts);
20054+
bool Res = vectorizeHorReduction(P, Root, BB, R, PostponedInsts);
2005620055
Res |= tryToVectorize(PostponedInsts, R);
2005720056
return Res;
2005820057
}
@@ -20317,7 +20316,7 @@ bool SLPVectorizerPass::vectorizeCmpInsts(iterator_range<ItT> CmpInsts,
2031720316
continue;
2031820317
for (Value *Op : I->operands())
2031920318
if (auto *RootOp = dyn_cast<Instruction>(Op))
20320-
Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R, TTI);
20319+
Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R);
2032120320
}
2032220321
// Try to vectorize operands as vector bundles.
2032320322
for (CmpInst *I : CmpInsts) {
@@ -20384,7 +20383,7 @@ bool SLPVectorizerPass::vectorizeInserts(InstSetVector &Instructions,
2038420383
// pass2 - try to vectorize reductions only
2038520384
if (R.isDeleted(I))
2038620385
continue;
20387-
OpsChanged |= vectorizeHorReduction(nullptr, I, BB, R, TTI, PostponedInsts);
20386+
OpsChanged |= vectorizeHorReduction(nullptr, I, BB, R, PostponedInsts);
2038820387
if (R.isDeleted(I) || isa<CmpInst>(I))
2038920388
continue;
2039020389
// pass3 - try to match and vectorize a buildvector sequence.
@@ -20644,7 +20643,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
2064420643
if (P->getNumIncomingValues() == 2) {
2064520644
// Try to match and vectorize a horizontal reduction.
2064620645
Instruction *Root = getReductionInstr(DT, P, BB, LI);
20647-
if (Root && vectorizeRootInstruction(P, Root, BB, R, TTI)) {
20646+
if (Root && vectorizeRootInstruction(P, Root, BB, R)) {
2064820647
Changed = true;
2064920648
It = BB->begin();
2065020649
E = BB->end();
@@ -20666,8 +20665,8 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
2066620665
// vectorization.
2066720666
if (auto *PI = dyn_cast<Instruction>(P->getIncomingValue(I));
2066820667
PI && !IsInPostProcessInstrs(PI)) {
20669-
bool Res = vectorizeRootInstruction(nullptr, PI,
20670-
P->getIncomingBlock(I), R, TTI);
20668+
bool Res =
20669+
vectorizeRootInstruction(nullptr, PI, P->getIncomingBlock(I), R);
2067120670
Changed |= Res;
2067220671
if (Res && R.isDeleted(P)) {
2067320672
It = BB->begin();
@@ -20701,7 +20700,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
2070120700
if (auto *VI = dyn_cast<Instruction>(V);
2070220701
VI && !IsInPostProcessInstrs(VI))
2070320702
// Try to match and vectorize a horizontal reduction.
20704-
OpsChanged |= vectorizeRootInstruction(nullptr, VI, BB, R, TTI);
20703+
OpsChanged |= vectorizeRootInstruction(nullptr, VI, BB, R);
2070520704
}
2070620705
}
2070720706
// Start vectorization of post-process list of instructions from the

0 commit comments

Comments
 (0)