[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
Chris Lattner
lattner at cs.uiuc.edu
Thu Mar 23 23:14:19 PST 2006
Changes in directory llvm/lib/Transforms/Scalar:
LoopUnswitch.cpp updated: 1.35 -> 1.36
---
Log message:
add the actual cost to the debug info
---
Diffs of the changes: (+4 -2)
LoopUnswitch.cpp | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
Index: llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
diff -u llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.35 llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.36
--- llvm/lib/Transforms/Scalar/LoopUnswitch.cpp:1.35 Wed Feb 22 17:55:00 2006
+++ llvm/lib/Transforms/Scalar/LoopUnswitch.cpp Fri Mar 24 01:14:00 2006
@@ -375,7 +375,8 @@
/// 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 @@
// 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;
}
More information about the llvm-commits
mailing list