diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-10-01 23:52:22 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-10-01 23:52:22 +0000 |
commit | a9b85c1074dd91ef6702b4c13499c5900616ad02 (patch) | |
tree | aecaa2767c839d34b51be2d8ef6675aaae6f3dba /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 21ea1d5b4cad8c8dee1288453f797572766c94d8 (diff) |
Pretty up the debug output during RemoveCopyByCommutingDef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115384 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index c111261acf..5a83175009 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -406,7 +406,8 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, 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 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, 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 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, // 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 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, } 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 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, 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; } |