[llvm-commits] [llvm] r47542 - in /llvm/trunk: lib/Analysis/ScalarEvolution.cpp test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll

Evan Cheng evan.cheng at apple.com
Sun Feb 24 19:57:32 PST 2008


Author: evancheng
Date: Sun Feb 24 21:57:32 2008
New Revision: 47542

URL: http://llvm.org/viewvc/llvm-project?rev=47542&view=rev
Log:
Temporarily reverting 46959.

Modified:
    llvm/trunk/lib/Analysis/ScalarEvolution.cpp
    llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll

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

==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Sun Feb 24 21:57:32 2008
@@ -1919,8 +1919,8 @@
 
   // At this point, we would like to compute how many iterations of the 
   // loop the predicate will return true for these inputs.
-  if (LHS->isLoopInvariant(L) && !RHS->isLoopInvariant(L)) {
-    // If there is a loop-invariant, force it into the RHS.
+  if (isa<SCEVConstant>(LHS) && !isa<SCEVConstant>(RHS)) {
+    // If there is a constant, force it into the RHS.
     std::swap(LHS, RHS);
     Cond = ICmpInst::getSwappedPredicate(Cond);
   }

Modified: llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll?rev=47542&r1=47541&r2=47542&view=diff

==============================================================================
--- llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll (original)
+++ llvm/trunk/test/Analysis/ScalarEvolution/2008-02-11-ReversedCondition.ll Sun Feb 24 21:57:32 2008
@@ -1,4 +1,5 @@
 ; RUN: llvm-as < %s | opt -scalar-evolution -analyze | grep {Loop header: ( 0 smax  %n) iterations!}
+; XFAIL: *
 
 define void @foo(i32 %n) {
 entry:





More information about the llvm-commits mailing list