aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopUnswitch.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-03-24 07:14:00 +0000
committerChris Lattner <sabre@nondot.org>2006-03-24 07:14:00 +0000
commit0f862e50aebccf893afd62bb901456d721b7f054 (patch)
treeba5f33bd0b565944f359a3b6642f3f730cda7fff /lib/Transforms/Scalar/LoopUnswitch.cpp
parent52da8845c6d24836ed0ca2341f2114dc248fba4b (diff)
add the actual cost to the debug info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopUnswitch.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index b0be443c11..c583eea14d 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -375,7 +375,8 @@ unsigned LoopUnswitch::getLoopUnswitchCost(Loop *L, Value *LIC) {
/// unswitch the loop, reprocess the pieces, then return true.
bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val,Loop *L){
// Check to see if it would be profitable to unswitch this loop.
- if (getLoopUnswitchCost(L, LoopCond) > Threshold) {
+ unsigned Cost = getLoopUnswitchCost(L, LoopCond);
+ if (Cost > Threshold) {
// FIXME: this should estimate growth by the amount of code shared by the
// resultant unswitched loops.
//
@@ -390,7 +391,8 @@ bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val,Loop *L){
// these values.
if (LoopValuesUsedOutsideLoop(L)) {
DEBUG(std::cerr << "NOT unswitching loop %" << L->getHeader()->getName()
- << ", a loop value is used outside loop!\n");
+ << ", a loop value is used outside loop! Cost: "
+ << Cost << "\n");
return false;
}