@@ -19949,7 +19949,7 @@ static bool isReductionCandidate(Instruction *I) {
19949
19949
}
19950
19950
19951
19951
bool SLPVectorizerPass::vectorizeHorReduction(
19952
- PHINode *P, Instruction *Root, BasicBlock *BB, BoUpSLP &R, TargetTransformInfo *TTI,
19952
+ PHINode *P, Instruction *Root, BasicBlock *BB, BoUpSLP &R,
19953
19953
SmallVectorImpl<WeakTrackingVH> &PostponedInsts) {
19954
19954
if (!ShouldVectorizeHor)
19955
19955
return false;
@@ -19982,7 +19982,7 @@ bool SLPVectorizerPass::vectorizeHorReduction(
19982
19982
Stack.emplace(SelectRoot(), 0);
19983
19983
SmallPtrSet<Value *, 8> VisitedInstrs;
19984
19984
bool Res = false;
19985
- auto &&TryToReduce = [this, TTI, &R](Instruction *Inst) -> Value * {
19985
+ auto &&TryToReduce = [this, &R](Instruction *Inst) -> Value * {
19986
19986
if (R.isAnalyzedReductionRoot(Inst))
19987
19987
return nullptr;
19988
19988
if (!isReductionCandidate(Inst))
@@ -20049,10 +20049,9 @@ bool SLPVectorizerPass::vectorizeHorReduction(
20049
20049
}
20050
20050
20051
20051
bool SLPVectorizerPass::vectorizeRootInstruction(PHINode *P, Instruction *Root,
20052
- BasicBlock *BB, BoUpSLP &R,
20053
- TargetTransformInfo *TTI) {
20052
+ BasicBlock *BB, BoUpSLP &R) {
20054
20053
SmallVector<WeakTrackingVH> PostponedInsts;
20055
- bool Res = vectorizeHorReduction(P, Root, BB, R, TTI, PostponedInsts);
20054
+ bool Res = vectorizeHorReduction(P, Root, BB, R, PostponedInsts);
20056
20055
Res |= tryToVectorize(PostponedInsts, R);
20057
20056
return Res;
20058
20057
}
@@ -20317,7 +20316,7 @@ bool SLPVectorizerPass::vectorizeCmpInsts(iterator_range<ItT> CmpInsts,
20317
20316
continue;
20318
20317
for (Value *Op : I->operands())
20319
20318
if (auto *RootOp = dyn_cast<Instruction>(Op))
20320
- Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R, TTI );
20319
+ Changed |= vectorizeRootInstruction(nullptr, RootOp, BB, R);
20321
20320
}
20322
20321
// Try to vectorize operands as vector bundles.
20323
20322
for (CmpInst *I : CmpInsts) {
@@ -20384,7 +20383,7 @@ bool SLPVectorizerPass::vectorizeInserts(InstSetVector &Instructions,
20384
20383
// pass2 - try to vectorize reductions only
20385
20384
if (R.isDeleted(I))
20386
20385
continue;
20387
- OpsChanged |= vectorizeHorReduction(nullptr, I, BB, R, TTI, PostponedInsts);
20386
+ OpsChanged |= vectorizeHorReduction(nullptr, I, BB, R, PostponedInsts);
20388
20387
if (R.isDeleted(I) || isa<CmpInst>(I))
20389
20388
continue;
20390
20389
// pass3 - try to match and vectorize a buildvector sequence.
@@ -20644,7 +20643,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
20644
20643
if (P->getNumIncomingValues() == 2) {
20645
20644
// Try to match and vectorize a horizontal reduction.
20646
20645
Instruction *Root = getReductionInstr(DT, P, BB, LI);
20647
- if (Root && vectorizeRootInstruction(P, Root, BB, R, TTI )) {
20646
+ if (Root && vectorizeRootInstruction(P, Root, BB, R)) {
20648
20647
Changed = true;
20649
20648
It = BB->begin();
20650
20649
E = BB->end();
@@ -20666,8 +20665,8 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
20666
20665
// vectorization.
20667
20666
if (auto *PI = dyn_cast<Instruction>(P->getIncomingValue(I));
20668
20667
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);
20671
20670
Changed |= Res;
20672
20671
if (Res && R.isDeleted(P)) {
20673
20672
It = BB->begin();
@@ -20701,7 +20700,7 @@ bool SLPVectorizerPass::vectorizeChainsInBlock(BasicBlock *BB, BoUpSLP &R) {
20701
20700
if (auto *VI = dyn_cast<Instruction>(V);
20702
20701
VI && !IsInPostProcessInstrs(VI))
20703
20702
// Try to match and vectorize a horizontal reduction.
20704
- OpsChanged |= vectorizeRootInstruction(nullptr, VI, BB, R, TTI );
20703
+ OpsChanged |= vectorizeRootInstruction(nullptr, VI, BB, R);
20705
20704
}
20706
20705
}
20707
20706
// Start vectorization of post-process list of instructions from the
0 commit comments