void StrengthReduceStridedIVUsers(const SCEVHandle &Stride,
IVUsersOfOneStride &Uses,
Loop *L, bool isOnlyStride);
- void DeleteTriviallyDeadInstructions(SetVector<Instruction*> &Insts);
+ void DeleteTriviallyDeadInstructions();
};
}
/// DeleteTriviallyDeadInstructions - If any of the instructions is the
/// specified set are trivially dead, delete them and see if this makes any of
/// their operands subsequently dead.
-void LoopStrengthReduce::
-DeleteTriviallyDeadInstructions(SetVector<Instruction*> &Insts) {
- while (!Insts.empty()) {
- Instruction *I = Insts.back();
- Insts.pop_back();
+void LoopStrengthReduce::DeleteTriviallyDeadInstructions() {
+ while (!DeadInsts.empty()) {
+ Instruction *I = DeadInsts.back();
+ DeadInsts.pop_back();
if (!isInstructionTriviallyDead(I))
continue;
if (Instruction *U = dyn_cast<Instruction>(*i)) {
*i = 0;
if (U->use_empty())
- Insts.insert(U);
+ DeadInsts.insert(U);
}
}
Rewriter, L, this,
DeadInsts);
- // Mark old value we replaced as possibly dead, so that it is elminated
+ // Mark old value we replaced as possibly dead, so that it is eliminated
// if we just replaced the last use of that value.
DeadInsts.insert(cast<Instruction>(User.OperandValToReplace));
// Clean up after ourselves
if (!DeadInsts.empty()) {
- DeleteTriviallyDeadInstructions(DeadInsts);
+ DeleteTriviallyDeadInstructions();
BasicBlock::iterator I = L->getHeader()->begin();
while (PHINode *PN = dyn_cast<PHINode>(I++)) {
break;
}
}
- DeleteTriviallyDeadInstructions(DeadInsts);
+ DeleteTriviallyDeadInstructions();
}
return Changed;
}