From: Devang Patel Date: Mon, 8 Dec 2008 17:02:37 +0000 (+0000) Subject: Undo previous patch. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6d9896f153359785299651bcffd363fdefd67a4c;p=oota-llvm.git Undo previous patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60701 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 2bf194dbb73..97aa475a67f 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -168,9 +168,7 @@ static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) { // TODO: Handle: br (VARIANT|INVARIANT). // TODO: Hoist simple expressions out of loops. - if (Instruction *I = dyn_cast(Cond)) - if (!L->contains(I->getParent())) - return 0; + if (L->isLoopInvariant(Cond)) return Cond; if (BinaryOperator *BO = dyn_cast(Cond)) if (BO->getOpcode() == Instruction::And || diff --git a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll index 430ada4e8c1..3bc57265ce7 100644 --- a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll +++ b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll @@ -1,4 +1,4 @@ -; RUN: llvm-as < %s | opt -loop-unswitch -stats | not grep loop-unswitch +; RUN: llvm-as < %s | opt -loop-unswitch -verify -disable-output define void @test_fc_while_continue_or(float %x, float %y, float* %result) nounwind {