summaryrefslogtreecommitdiff
path: root/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-09-04 20:36:36 +0000
committerDevang Patel <dpatel@apple.com>2008-09-04 20:36:36 +0000
commit027bb9254199bee2b99253de8fab55d14d4e2639 (patch)
treebfdd22a67d629005991815ba5481c8fc4fa92bc5 /lib/Transforms
parentf423abc289bca6c0b0cbb3c28bfb2f844bc7398f (diff)
downloadllvm-027bb9254199bee2b99253de8fab55d14d4e2639.tar.gz
llvm-027bb9254199bee2b99253de8fab55d14d4e2639.tar.bz2
llvm-027bb9254199bee2b99253de8fab55d14d4e2639.tar.xz
Initialize loop data first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55792 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index f9046a1a05..691a67a427 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -418,6 +418,7 @@ unsigned LoopUnswitch::getLoopUnswitchCost(Value *LIC) {
/// unswitch the loop, reprocess the pieces, then return true.
bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
+ initLoopData();
Function *F = loopHeader->getParent();
// Do not unswitch if the function is optimized for size.
@@ -441,8 +442,6 @@ bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){
return false;
}
- initLoopData();
-
Constant *CondVal;
BasicBlock *ExitBlock;
if (IsTrivialUnswitchCondition(LoopCond, &CondVal, &ExitBlock)) {