[llvm-commits] [llvm] r72008 - /llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Dan Gohman gohman at apple.com
Mon May 18 09:03:58 PDT 2009


Author: djg
Date: Mon May 18 11:03:58 2009
New Revision: 72008

URL: http://llvm.org/viewvc/llvm-project?rev=72008&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp

Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=72008&r1=72007&r2=72008&view=diff

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Mon May 18 11:03:58 2009
@@ -3328,6 +3328,10 @@
 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();
 





More information about the llvm-commits mailing list