[llvm-commits] [llvm] r115384 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Oct 1 16:52:22 PDT 2010
Author: stoklund
Date: Fri Oct 1 18:52:22 2010
New Revision: 115384
URL: http://llvm.org/viewvc/llvm-project?rev=115384&view=rev
Log:
Pretty up the debug output during RemoveCopyByCommutingDef.
Modified:
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=115384&r1=115383&r2=115384&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri Oct 1 18:52:22 2010
@@ -406,7 +406,8 @@
return false;
}
- DEBUG(dbgs() << "\tRemoveCopyByCommutingDef: " << *DefMI);
+ DEBUG(dbgs() << "\tRemoveCopyByCommutingDef: " << AValNo->def << '\t'
+ << *DefMI << "\t\tALR: " << *ALR << ", BLR: " << *BLR << '\n');
// At this point we have decided that it is legal to do this
// transformation. Start by commuting the instruction.
@@ -479,6 +480,7 @@
const LiveRange *DLR = IntB.getLiveRangeContaining(DefIdx);
if (!DLR)
continue;
+ DEBUG(dbgs() << "\t\tnoop: " << DefIdx << '\t' << *UseMI);
BHasPHIKill |= DLR->valno->hasPHIKill();
assert(DLR->valno->def == DefIdx);
BDeadValNos.push_back(DLR->valno);
@@ -488,10 +490,6 @@
// We need to insert a new liverange: [ALR.start, LastUse). It may be we can
// simply extend BLR if CopyMI doesn't end the range.
- DEBUG({
- dbgs() << "Extending: ";
- IntB.print(dbgs(), tri_);
- });
// Remove val#'s defined by copies that will be coalesced away.
for (unsigned i = 0, e = BDeadValNos.size(); i != e; ++i) {
@@ -507,6 +505,8 @@
}
IntB.removeValNo(BDeadValNos[i]);
}
+ DEBUG(dbgs() << "\t\ttrimmed: " << IntB << '\n');
+
// Extend BValNo by merging in IntA live ranges of AValNo. Val# definition
// is updated.
@@ -524,22 +524,10 @@
IntB.addRange(LiveRange(AI->start, End, ValNo));
}
ValNo->setHasPHIKill(BHasPHIKill);
-
- DEBUG({
- dbgs() << " result = ";
- IntB.print(dbgs(), tri_);
- dbgs() << "\nShortening: ";
- IntA.print(dbgs(), tri_);
- });
+ DEBUG(dbgs() << "\t\textended: " << IntB << '\n');
IntA.removeValNo(AValNo);
-
- DEBUG({
- dbgs() << " result = ";
- IntA.print(dbgs(), tri_);
- dbgs() << '\n';
- });
-
+ DEBUG(dbgs() << "\t\ttrimmed: " << IntA << '\n');
++numCommutes;
return true;
}
More information about the llvm-commits
mailing list