diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-02 02:52:02 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-02 02:52:02 +0000 |
| commit | 75a44e154e3683a301761ec88216b9e494919a7f (patch) | |
| tree | 61d0dca952aa4dae8ca13f74395ea61f1598bda5 /llvm/lib/Transforms | |
| parent | dcce49e006ede1cecb3d109f31612759a89f2fcb (diff) | |
| download | bcm5719-llvm-75a44e154e3683a301761ec88216b9e494919a7f.tar.gz bcm5719-llvm-75a44e154e3683a301761ec88216b9e494919a7f.zip | |
add a comment, make a check more lenient
llvm-svn: 22581
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index a39ba6eda26..fcb7ad3dfde 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -71,6 +71,9 @@ namespace { const TargetData *TD; const Type *UIntPtrTy; 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; /// 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. if (PN->hasOneUse()) { BinaryOperator *BO = dyn_cast<BinaryOperator>(*(PN->use_begin())); - if (BO && BO->getOpcode() == Instruction::Add) - if (BO->hasOneUse()) { - if (PN == dyn_cast<PHINode>(*(BO->use_begin()))) { - DeadInsts.insert(BO); - // Break the cycle, then delete the PHI. - PN->replaceAllUsesWith(UndefValue::get(PN->getType())); - PN->eraseFromParent(); - } + if (BO && BO->hasOneUse()) { + if (PN == *(BO->use_begin())) { + DeadInsts.insert(BO); + // Break the cycle, then delete the PHI. + PN->replaceAllUsesWith(UndefValue::get(PN->getType())); + PN->eraseFromParent(); } + } } } DeleteTriviallyDeadInstructions(DeadInsts); |

