diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-02-10 01:36:35 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-02-10 01:36:35 +0000 |
| commit | 3fc3148b85b70e4365815600adfcc5ff686b1599 (patch) | |
| tree | 38e144285a00be3fd3acd9a3c96c14ba5436635a /llvm/lib/Transforms | |
| parent | ed7a67b0de9f16b399c18ef517aba9153cae323d (diff) | |
| download | bcm5719-llvm-3fc3148b85b70e4365815600adfcc5ff686b1599.tar.gz bcm5719-llvm-3fc3148b85b70e4365815600adfcc5ff686b1599.zip | |
When unswitching a trivial loop, do admit we are doing it! :)
llvm-svn: 26102
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index f0593255f26..b130689081d 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -346,6 +346,11 @@ static Loop *CloneLoop(Loop *L, Loop *PL, std::map<const Value*, Value*> &VM, /// moving the conditional branch outside of the loop and updating loop info. void LoopUnswitch::UnswitchTrivialCondition(Loop *L, Value *Cond, ConstantBool *LoopCond) { + DEBUG(std::cerr << "loop-unswitch: Trivial-Unswitch loop %" + << L->getHeader()->getName() << " [" << L->getBlocks().size() + << " blocks] in Function " << L->getHeader()->getParent()->getName() + << " on cond:" << *Cond << "\n"); + // First step, split the preahder, so that we know that there is a safe place // to insert the conditional branch. We will change 'OrigPH' to have a // conditional branch on Cond. @@ -373,6 +378,8 @@ void LoopUnswitch::UnswitchTrivialCondition(Loop *L, Value *Cond, // particular value, rewrite the loop with this info. We know that this will // at least eliminate the old branch. RewriteLoopBodyWithConditionConstant(L, Cond, EnterOnTrue); + + ++NumUnswitched; } |

