mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 00:21:03 +00:00
Add LiveIntervalMap::dumpCache() to print out the cache used by the ssa update algorithm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123925 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -449,6 +449,7 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
|
|||||||
// VNInfo. Insert phi-def VNInfos along the path back to IdxMBB.
|
// VNInfo. Insert phi-def VNInfos along the path back to IdxMBB.
|
||||||
DEBUG(dbgs() << "\n Reaching defs for BB#" << IdxMBB->getNumber()
|
DEBUG(dbgs() << "\n Reaching defs for BB#" << IdxMBB->getNumber()
|
||||||
<< " at " << Idx << " in " << *li_ << '\n');
|
<< " at " << Idx << " in " << *li_ << '\n');
|
||||||
|
DEBUG(dumpCache());
|
||||||
|
|
||||||
// Blocks where li_ should be live-in.
|
// Blocks where li_ should be live-in.
|
||||||
SmallVector<MachineDomTreeNode*, 16> LiveIn;
|
SmallVector<MachineDomTreeNode*, 16> LiveIn;
|
||||||
@@ -586,6 +587,7 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
|
|||||||
assert(IdxVNI && "Didn't find value for Idx");
|
assert(IdxVNI && "Didn't find value for Idx");
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
|
DEBUG(dumpCache());
|
||||||
// Check the liveOutCache_ invariants.
|
// Check the liveOutCache_ invariants.
|
||||||
for (LiveOutMap::iterator I = liveOutCache_.begin(), E = liveOutCache_.end();
|
for (LiveOutMap::iterator I = liveOutCache_.begin(), E = liveOutCache_.end();
|
||||||
I != E; ++I) {
|
I != E; ++I) {
|
||||||
@@ -620,6 +622,25 @@ VNInfo *LiveIntervalMap::mapValue(const VNInfo *ParentVNI, SlotIndex Idx,
|
|||||||
return IdxVNI;
|
return IdxVNI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
|
void LiveIntervalMap::dumpCache() {
|
||||||
|
for (LiveOutMap::iterator I = liveOutCache_.begin(), E = liveOutCache_.end();
|
||||||
|
I != E; ++I) {
|
||||||
|
assert(I->first && "Null MBB entry in cache");
|
||||||
|
assert(I->second.first && "Null VNInfo in cache");
|
||||||
|
assert(I->second.second && "Null DomTreeNode in cache");
|
||||||
|
dbgs() << " cache: BB#" << I->first->getNumber()
|
||||||
|
<< " has valno #" << I->second.first->id << " from BB#"
|
||||||
|
<< I->second.second->getBlock()->getNumber() << ", preds";
|
||||||
|
for (MachineBasicBlock::pred_iterator PI = I->first->pred_begin(),
|
||||||
|
PE = I->first->pred_end(); PI != PE; ++PI)
|
||||||
|
dbgs() << " BB#" << (*PI)->getNumber();
|
||||||
|
dbgs() << '\n';
|
||||||
|
}
|
||||||
|
dbgs() << " cache: " << liveOutCache_.size() << " entries.\n";
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// extendTo - Find the last li_ value defined in MBB at or before Idx. The
|
// extendTo - Find the last li_ value defined in MBB at or before Idx. The
|
||||||
// parentli_ is assumed to be live at Idx. Extend the live range to Idx.
|
// parentli_ is assumed to be live at Idx. Extend the live range to Idx.
|
||||||
// Return the found VNInfo, or NULL.
|
// Return the found VNInfo, or NULL.
|
||||||
|
@@ -216,6 +216,9 @@ class LiveIntervalMap {
|
|||||||
// The cache is also used as a visiteed set by mapValue().
|
// The cache is also used as a visiteed set by mapValue().
|
||||||
LiveOutMap liveOutCache_;
|
LiveOutMap liveOutCache_;
|
||||||
|
|
||||||
|
// Dump the live-out cache to dbgs().
|
||||||
|
void dumpCache();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LiveIntervalMap(LiveIntervals &lis,
|
LiveIntervalMap(LiveIntervals &lis,
|
||||||
MachineDominatorTree &mdt,
|
MachineDominatorTree &mdt,
|
||||||
|
Reference in New Issue
Block a user