Temporarily reverting 46959.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47542 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2008-02-25 03:57:32 +00:00
parent 0f7ea1ab10
commit b9a905781e
2 changed files with 3 additions and 2 deletions

View File

@ -1919,8 +1919,8 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {
// 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);
}

View File

@ -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: