mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-21 06:30:16 +00:00
Remove unused simplifyIVUsers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153262 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
db0d666578
commit
9f2539507c
@ -49,12 +49,6 @@ bool simplifyUsersOfIV(PHINode *CurrIV, ScalarEvolution *SE, LPPassManager *LPM,
|
|||||||
bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, LPPassManager *LPM,
|
bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, LPPassManager *LPM,
|
||||||
SmallVectorImpl<WeakVH> &Dead);
|
SmallVectorImpl<WeakVH> &Dead);
|
||||||
|
|
||||||
/// simplifyIVUsers - Simplify instructions recorded by the IVUsers pass.
|
|
||||||
/// This is a legacy implementation to reproduce the behavior of the
|
|
||||||
/// IndVarSimplify pass prior to DisableIVRewrite.
|
|
||||||
bool simplifyIVUsers(IVUsers *IU, ScalarEvolution *SE, LPPassManager *LPM,
|
|
||||||
SmallVectorImpl<WeakVH> &Dead);
|
|
||||||
|
|
||||||
} // namespace llvm
|
} // namespace llvm
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,7 +46,6 @@ namespace {
|
|||||||
LoopInfo *LI;
|
LoopInfo *LI;
|
||||||
DominatorTree *DT;
|
DominatorTree *DT;
|
||||||
ScalarEvolution *SE;
|
ScalarEvolution *SE;
|
||||||
IVUsers *IU; // NULL for DisableIVRewrite
|
|
||||||
const TargetData *TD; // May be NULL
|
const TargetData *TD; // May be NULL
|
||||||
|
|
||||||
SmallVectorImpl<WeakVH> &DeadInsts;
|
SmallVectorImpl<WeakVH> &DeadInsts;
|
||||||
@ -59,7 +58,6 @@ namespace {
|
|||||||
L(Loop),
|
L(Loop),
|
||||||
LI(LPM->getAnalysisIfAvailable<LoopInfo>()),
|
LI(LPM->getAnalysisIfAvailable<LoopInfo>()),
|
||||||
SE(SE),
|
SE(SE),
|
||||||
IU(IVU),
|
|
||||||
TD(LPM->getAnalysisIfAvailable<TargetData>()),
|
TD(LPM->getAnalysisIfAvailable<TargetData>()),
|
||||||
DeadInsts(Dead),
|
DeadInsts(Dead),
|
||||||
Changed(false) {
|
Changed(false) {
|
||||||
@ -229,13 +227,6 @@ void SimplifyIndvar::eliminateIVRemainder(BinaryOperator *Rem,
|
|||||||
Rem->replaceAllUsesWith(Sel);
|
Rem->replaceAllUsesWith(Sel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Inform IVUsers about the new users.
|
|
||||||
if (IU) {
|
|
||||||
if (Instruction *I = dyn_cast<Instruction>(Rem->getOperand(0))) {
|
|
||||||
SmallPtrSet<Loop*, 16> SimplifiedLoopNests;
|
|
||||||
IU->AddUsersIfInteresting(I, SimplifiedLoopNests);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
DEBUG(dbgs() << "INDVARS: Simplified rem: " << *Rem << '\n');
|
DEBUG(dbgs() << "INDVARS: Simplified rem: " << *Rem << '\n');
|
||||||
++NumElimRem;
|
++NumElimRem;
|
||||||
Changed = true;
|
Changed = true;
|
||||||
@ -401,36 +392,4 @@ bool simplifyLoopIVs(Loop *L, ScalarEvolution *SE, LPPassManager *LPM,
|
|||||||
return Changed;
|
return Changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// simplifyIVUsers - Perform simplification on instructions recorded by the
|
|
||||||
/// IVUsers pass.
|
|
||||||
///
|
|
||||||
/// This is the old approach to IV simplification to be replaced by
|
|
||||||
/// SimplifyLoopIVs.
|
|
||||||
bool simplifyIVUsers(IVUsers *IU, ScalarEvolution *SE, LPPassManager *LPM,
|
|
||||||
SmallVectorImpl<WeakVH> &Dead) {
|
|
||||||
SimplifyIndvar SIV(IU->getLoop(), SE, LPM, Dead);
|
|
||||||
|
|
||||||
// Each round of simplification involves a round of eliminating operations
|
|
||||||
// followed by a round of widening IVs. A single IVUsers worklist is used
|
|
||||||
// across all rounds. The inner loop advances the user. If widening exposes
|
|
||||||
// more uses, then another pass through the outer loop is triggered.
|
|
||||||
for (IVUsers::iterator I = IU->begin(); I != IU->end(); ++I) {
|
|
||||||
Instruction *UseInst = I->getUser();
|
|
||||||
Value *IVOperand = I->getOperandValToReplace();
|
|
||||||
|
|
||||||
if (ICmpInst *ICmp = dyn_cast<ICmpInst>(UseInst)) {
|
|
||||||
SIV.eliminateIVComparison(ICmp, IVOperand);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (BinaryOperator *Rem = dyn_cast<BinaryOperator>(UseInst)) {
|
|
||||||
bool IsSigned = Rem->getOpcode() == Instruction::SRem;
|
|
||||||
if (IsSigned || Rem->getOpcode() == Instruction::URem) {
|
|
||||||
SIV.eliminateIVRemainder(Rem, IVOperand, IsSigned);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return SIV.hasChanged();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace llvm
|
} // namespace llvm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user