aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-16 01:24:41 +0000
committerChris Lattner <sabre@nondot.org>2006-02-16 01:24:41 +0000
commitf17c42d409ce9d981996dea11918774e84400eea (patch)
treea3b64d8f731ca2d847b8bebb154452b3a30b2309 /lib/Transforms/Scalar/LoopUnswitch.cpp
parent18a8452f3d2cc0bbfea427b10e2c7dccc86f2188 (diff)
fix a bug where we unswitched the wrong way
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26225 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 46705f3388..d36e59d9ec 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -197,9 +197,9 @@ static bool IsTrivialUnswitchCondition(Loop *L, Value *Cond,
// side-effects. If so, determine the value of Cond that causes it to do
// this.
if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(0)))) {
- if (Val) *Val = ConstantBool::True;
- } else if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(1)))) {
if (Val) *Val = ConstantBool::False;
+ } else if ((LoopExitBB = isTrivialLoopExitBlock(L, BI->getSuccessor(1)))) {
+ if (Val) *Val = ConstantBool::True;
}
} else if (SwitchInst *SI = dyn_cast<SwitchInst>(HeaderTerm)) {
// If this isn't a switch on Cond, we can't handle it.