diff options
| author | Dan Gohman <gohman@apple.com> | 2009-05-18 16:03:58 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-05-18 16:03:58 +0000 |
| commit | 9cf09f8291c493750c1b35d43f7636ac1fa4ff86 (patch) | |
| tree | 72d371156c624cb656fa608b1a3cf01392eab4f5 | |
| parent | 4fc3668a924e6249b522dd9aa559127d8de376b2 (diff) | |
| download | bcm5719-llvm-9cf09f8291c493750c1b35d43f7636ac1fa4ff86.tar.gz bcm5719-llvm-9cf09f8291c493750c1b35d43f7636ac1fa4ff86.zip | |
Fix ScalarEvolution::isLoopGuardedByCond to accept a null Loop*, for
consistency with other routines that use a null Loop* to mean code
not contained by any loop.
llvm-svn: 72008
| -rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 30d6e7088c8..c53ec8a5f1a 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -3328,6 +3328,10 @@ ScalarEvolution::getPredecessorWithUniqueSuccessorForBB(BasicBlock *BB) { bool ScalarEvolution::isLoopGuardedByCond(const Loop *L, ICmpInst::Predicate Pred, const SCEV *LHS, const SCEV *RHS) { + // Interpret a null as meaning no loop, where there is obviously no guard + // (interprocedural conditions notwithstanding). + if (!L) return false; + BasicBlock *Predecessor = getLoopPredecessor(L); BasicBlock *PredecessorDest = L->getHeader(); |

