summaryrefslogtreecommitdiffstats
path: root/llvm/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
commit00ec74616b7cbe4f733ce23f12ad21c893bb503d (patch)
tree14497af1f4a96f7bbff89851ccdc6a6f3a8b4d32 /llvm/lib/Transforms
parent217836527c8a818300123f4b49cfa25ca5bcd72a (diff)
downloadbcm5719-llvm-00ec74616b7cbe4f733ce23f12ad21c893bb503d.tar.gz
bcm5719-llvm-00ec74616b7cbe4f733ce23f12ad21c893bb503d.zip
Initialize loop data first.
llvm-svn: 55792
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopUnswitch.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
index f9046a1a055..691a67a4275 100644
--- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/llvm/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)) {
OpenPOWER on IntegriCloud