From 00ec74616b7cbe4f733ce23f12ad21c893bb503d Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Thu, 4 Sep 2008 20:36:36 +0000 Subject: Initialize loop data first. llvm-svn: 55792 --- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp') 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)) { -- cgit v1.2.3