mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-05 18:37:17 +00:00
add a comment, make a check more lenient
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22581 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e9100c69cb
commit
7e608bbb5d
@ -71,6 +71,9 @@ namespace {
|
|||||||
const TargetData *TD;
|
const TargetData *TD;
|
||||||
const Type *UIntPtrTy;
|
const Type *UIntPtrTy;
|
||||||
bool Changed;
|
bool Changed;
|
||||||
|
|
||||||
|
/// MaxTargetAMSize - This is the maximum power-of-two scale value that the
|
||||||
|
/// target can handle for free with its addressing modes.
|
||||||
unsigned MaxTargetAMSize;
|
unsigned MaxTargetAMSize;
|
||||||
|
|
||||||
/// IVUsesByStride - Keep track of all uses of induction variables that we
|
/// IVUsesByStride - Keep track of all uses of induction variables that we
|
||||||
@ -649,15 +652,14 @@ void LoopStrengthReduce::runOnLoop(Loop *L) {
|
|||||||
// compared against some value to decide loop termination.
|
// compared against some value to decide loop termination.
|
||||||
if (PN->hasOneUse()) {
|
if (PN->hasOneUse()) {
|
||||||
BinaryOperator *BO = dyn_cast<BinaryOperator>(*(PN->use_begin()));
|
BinaryOperator *BO = dyn_cast<BinaryOperator>(*(PN->use_begin()));
|
||||||
if (BO && BO->getOpcode() == Instruction::Add)
|
if (BO && BO->hasOneUse()) {
|
||||||
if (BO->hasOneUse()) {
|
if (PN == *(BO->use_begin())) {
|
||||||
if (PN == dyn_cast<PHINode>(*(BO->use_begin()))) {
|
DeadInsts.insert(BO);
|
||||||
DeadInsts.insert(BO);
|
// Break the cycle, then delete the PHI.
|
||||||
// Break the cycle, then delete the PHI.
|
PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
|
||||||
PN->replaceAllUsesWith(UndefValue::get(PN->getType()));
|
PN->eraseFromParent();
|
||||||
PN->eraseFromParent();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DeleteTriviallyDeadInstructions(DeadInsts);
|
DeleteTriviallyDeadInstructions(DeadInsts);
|
||||||
|
Loading…
Reference in New Issue
Block a user