diff options
| author | Dan Gohman <gohman@apple.com> | 2010-07-20 00:57:18 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-07-20 00:57:18 +0000 |
| commit | 3ff13affda01f263b87eee0dfad166b6dcf11523 (patch) | |
| tree | 43775481a807bdc243130c849eac8287ac69081b /llvm/lib/Analysis | |
| parent | 08645f199178e971a5f6d8ecb5ff4771f6f5623b (diff) | |
| download | bcm5719-llvm-3ff13affda01f263b87eee0dfad166b6dcf11523.tar.gz bcm5719-llvm-3ff13affda01f263b87eee0dfad166b6dcf11523.zip | |
Minor code simplification.
llvm-svn: 108793
Diffstat (limited to 'llvm/lib/Analysis')
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolutionNormalization.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp b/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp index 563fd2fa96e..565b6f3507c 100644 --- a/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp +++ b/llvm/lib/Analysis/ScalarEvolutionNormalization.cpp @@ -50,13 +50,10 @@ static bool IVUseShouldUsePostIncValue(Instruction *User, Instruction *IV, // Look at all of the uses of IV by the PHI node. If any use corresponds to // a block that is not dominated by the latch block, give up and use the // preincremented value. - unsigned NumUses = 0; for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) - if (PN->getIncomingValue(i) == IV) { - ++NumUses; - if (!DT->dominates(LatchBlock, PN->getIncomingBlock(i))) - return false; - } + if (PN->getIncomingValue(i) == IV && + !DT->dominates(LatchBlock, PN->getIncomingBlock(i))) + return false; // Okay, all uses of IV by PN are in predecessor blocks that really are // dominated by the latch block. Use the post-incremented value. |

