diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-03-24 07:14:00 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-03-24 07:14:00 +0000 |
| commit | 5821a6a17a778385379d70154790a284a34dd72d (patch) | |
| tree | 5933028dcda5dd67cb1e0ec81a42cb85d7cb485e /llvm/lib/Transforms | |
| parent | c097dae1557138c162cc819b34bf56f1503820e3 (diff) | |
| download | bcm5719-llvm-5821a6a17a778385379d70154790a284a34dd72d.tar.gz bcm5719-llvm-5821a6a17a778385379d70154790a284a34dd72d.zip | |
add the actual cost to the debug info
llvm-svn: 27051
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index b0be443c116..c583eea14d6 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/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; } |

