mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Clean up debug output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110940 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -201,8 +201,6 @@ void VirtRegAuxInfo::CalculateRegClass(unsigned reg) {
|
|||||||
// This could happen if reg is only used by COPY instructions, so we may need
|
// This could happen if reg is only used by COPY instructions, so we may need
|
||||||
// to improve on this.
|
// to improve on this.
|
||||||
if (rcs.empty()) {
|
if (rcs.empty()) {
|
||||||
DEBUG(dbgs() << "Not inflating unconstrained" << orc->getName() << ":%reg"
|
|
||||||
<< reg << ".\n");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,11 +72,10 @@ void SplitAnalysis::analyzeUses() {
|
|||||||
if (MachineLoop *Loop = loops_.getLoopFor(MBB))
|
if (MachineLoop *Loop = loops_.getLoopFor(MBB))
|
||||||
usingLoops_.insert(Loop);
|
usingLoops_.insert(Loop);
|
||||||
}
|
}
|
||||||
DEBUG(dbgs() << "Counted "
|
DEBUG(dbgs() << " counted "
|
||||||
<< usingInstrs_.size() << " instrs, "
|
<< usingInstrs_.size() << " instrs, "
|
||||||
<< usingBlocks_.size() << " blocks, "
|
<< usingBlocks_.size() << " blocks, "
|
||||||
<< usingLoops_.size() << " loops in "
|
<< usingLoops_.size() << " loops.\n");
|
||||||
<< *curli_ << "\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get three sets of basic blocks surrounding a loop: Blocks inside the loop,
|
// Get three sets of basic blocks surrounding a loop: Blocks inside the loop,
|
||||||
@ -226,7 +225,7 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
|
|
||||||
// FIXME: We need an SSA updater to properly handle multiple exit blocks.
|
// FIXME: We need an SSA updater to properly handle multiple exit blocks.
|
||||||
if (Blocks.Exits.size() > 1) {
|
if (Blocks.Exits.size() > 1) {
|
||||||
DEBUG(dbgs() << "MultipleExits: " << **I);
|
DEBUG(dbgs() << " multiple exits from " << **I);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,15 +238,16 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
LPS = &SecondLoops;
|
LPS = &SecondLoops;
|
||||||
break;
|
break;
|
||||||
case ContainedInLoop:
|
case ContainedInLoop:
|
||||||
DEBUG(dbgs() << "ContainedInLoop: " << **I);
|
DEBUG(dbgs() << " contained in " << **I);
|
||||||
continue;
|
continue;
|
||||||
case SinglePeripheral:
|
case SinglePeripheral:
|
||||||
DEBUG(dbgs() << "SinglePeripheral: " << **I);
|
DEBUG(dbgs() << " single peripheral use in " << **I);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// Will it be possible to split around this loop?
|
// Will it be possible to split around this loop?
|
||||||
getCriticalExits(Blocks, CriticalExits);
|
getCriticalExits(Blocks, CriticalExits);
|
||||||
DEBUG(dbgs() << CriticalExits.size() << " critical exits: " << **I);
|
DEBUG(dbgs() << " " << CriticalExits.size() << " critical exits from "
|
||||||
|
<< **I);
|
||||||
if (!canSplitCriticalExits(Blocks, CriticalExits))
|
if (!canSplitCriticalExits(Blocks, CriticalExits))
|
||||||
continue;
|
continue;
|
||||||
// This is a possible split.
|
// This is a possible split.
|
||||||
@ -255,8 +255,8 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
LPS->insert(*I);
|
LPS->insert(*I);
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG(dbgs() << "Got " << Loops.size() << " + " << SecondLoops.size()
|
DEBUG(dbgs() << " getBestSplitLoop found " << Loops.size() << " + "
|
||||||
<< " candidate loops\n");
|
<< SecondLoops.size() << " candidate loops.\n");
|
||||||
|
|
||||||
// If there are no first class loops available, look at second class loops.
|
// If there are no first class loops available, look at second class loops.
|
||||||
if (Loops.empty())
|
if (Loops.empty())
|
||||||
@ -275,7 +275,7 @@ const MachineLoop *SplitAnalysis::getBestSplitLoop() {
|
|||||||
if (!Best || Idx < BestIdx)
|
if (!Best || Idx < BestIdx)
|
||||||
Best = *I, BestIdx = Idx;
|
Best = *I, BestIdx = Idx;
|
||||||
}
|
}
|
||||||
DEBUG(dbgs() << "Best: " << *Best);
|
DEBUG(dbgs() << " getBestSplitLoop found " << *Best);
|
||||||
return Best;
|
return Best;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +345,6 @@ LiveInterval *SplitEditor::getDupLI() {
|
|||||||
// Create an interval for dupli that is a copy of curli.
|
// Create an interval for dupli that is a copy of curli.
|
||||||
dupli_ = createInterval();
|
dupli_ = createInterval();
|
||||||
dupli_->Copy(*curli_, &mri_, lis_.getVNInfoAllocator());
|
dupli_->Copy(*curli_, &mri_, lis_.getVNInfoAllocator());
|
||||||
DEBUG(dbgs() << "SplitEditor DupLI: " << *dupli_ << '\n');
|
|
||||||
}
|
}
|
||||||
return dupli_;
|
return dupli_;
|
||||||
}
|
}
|
||||||
@ -408,7 +407,7 @@ void SplitEditor::enterIntvAtEnd(MachineBasicBlock &A, MachineBasicBlock &B) {
|
|||||||
SlotIndex EndA = lis_.getMBBEndIdx(&A);
|
SlotIndex EndA = lis_.getMBBEndIdx(&A);
|
||||||
VNInfo *CurVNIA = curli_->getVNInfoAt(EndA.getPrevIndex());
|
VNInfo *CurVNIA = curli_->getVNInfoAt(EndA.getPrevIndex());
|
||||||
if (!CurVNIA) {
|
if (!CurVNIA) {
|
||||||
DEBUG(dbgs() << " ignoring enterIntvAtEnd, curli not live out of BB#"
|
DEBUG(dbgs() << " enterIntvAtEnd, curli not live out of BB#"
|
||||||
<< A.getNumber() << ".\n");
|
<< A.getNumber() << ".\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -479,7 +478,7 @@ void SplitEditor::useIntv(SlotIndex Start, SlotIndex End) {
|
|||||||
for (;I != E && I->start < End; ++I)
|
for (;I != E && I->start < End; ++I)
|
||||||
openli_->addRange(LiveRange(I->start, std::min(End, I->end),
|
openli_->addRange(LiveRange(I->start, std::min(End, I->end),
|
||||||
mapValue(I->valno)));
|
mapValue(I->valno)));
|
||||||
DEBUG(dbgs() << " added range [" << Start << ';' << End << "): " << *openli_
|
DEBUG(dbgs() << " use [" << Start << ';' << End << "): " << *openli_
|
||||||
<< '\n');
|
<< '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -489,7 +488,7 @@ void SplitEditor::leaveIntvAfter(SlotIndex Idx) {
|
|||||||
|
|
||||||
const LiveRange *CurLR = curli_->getLiveRangeContaining(Idx.getDefIndex());
|
const LiveRange *CurLR = curli_->getLiveRangeContaining(Idx.getDefIndex());
|
||||||
if (!CurLR || CurLR->end <= Idx.getBoundaryIndex()) {
|
if (!CurLR || CurLR->end <= Idx.getBoundaryIndex()) {
|
||||||
DEBUG(dbgs() << " leaveIntvAfter at " << Idx << ": not live\n");
|
DEBUG(dbgs() << " leaveIntvAfter " << Idx << ": not live\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -638,9 +637,10 @@ void SplitEditor::rewrite() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (LI)
|
if (LI) {
|
||||||
MO.setReg(LI->reg);
|
MO.setReg(LI->reg);
|
||||||
DEBUG(dbgs() << "rewrite " << Idx << '\t' << *MI);
|
DEBUG(dbgs() << " rewrite " << Idx << '\t' << *MI);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// dupli_ goes in last, after rewriting.
|
// dupli_ goes in last, after rewriting.
|
||||||
@ -655,8 +655,8 @@ void SplitEditor::rewrite() {
|
|||||||
LiveInterval &li = *intervals_[i];
|
LiveInterval &li = *intervals_[i];
|
||||||
vrai.CalculateRegClass(li.reg);
|
vrai.CalculateRegClass(li.reg);
|
||||||
vrai.CalculateWeightAndHint(li);
|
vrai.CalculateWeightAndHint(li);
|
||||||
DEBUG(dbgs() << "new intv " << mri_.getRegClass(li.reg)->getName() << ":"
|
DEBUG(dbgs() << " new interval " << mri_.getRegClass(li.reg)->getName()
|
||||||
<< li << '\n');
|
<< ":" << li << '\n');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ bool SplitEditor::splitAroundLoop(const MachineLoop *Loop) {
|
|||||||
/// basic block in Blocks. Return true if curli has been completely replaced,
|
/// basic block in Blocks. Return true if curli has been completely replaced,
|
||||||
/// false if curli is still intact, and needs to be spilled or split further.
|
/// false if curli is still intact, and needs to be spilled or split further.
|
||||||
bool SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
bool SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
||||||
DEBUG(dbgs() << "splitSingleBlocks for " << Blocks.size() << " blocks.\n");
|
DEBUG(dbgs() << " splitSingleBlocks for " << Blocks.size() << " blocks.\n");
|
||||||
// Determine the first and last instruction using curli in each block.
|
// Determine the first and last instruction using curli in each block.
|
||||||
typedef std::pair<SlotIndex,SlotIndex> IndexPair;
|
typedef std::pair<SlotIndex,SlotIndex> IndexPair;
|
||||||
typedef DenseMap<const MachineBasicBlock*,IndexPair> IndexPairMap;
|
typedef DenseMap<const MachineBasicBlock*,IndexPair> IndexPairMap;
|
||||||
@ -722,7 +722,7 @@ bool SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
|||||||
if (!Blocks.count(MBB))
|
if (!Blocks.count(MBB))
|
||||||
continue;
|
continue;
|
||||||
SlotIndex Idx = lis_.getInstructionIndex(*I);
|
SlotIndex Idx = lis_.getInstructionIndex(*I);
|
||||||
DEBUG(dbgs() << "BB#" << MBB->getNumber() << '\t' << Idx << '\t' << **I);
|
DEBUG(dbgs() << " BB#" << MBB->getNumber() << '\t' << Idx << '\t' << **I);
|
||||||
IndexPair &IP = MBBRange[MBB];
|
IndexPair &IP = MBBRange[MBB];
|
||||||
if (!IP.first.isValid() || Idx < IP.first)
|
if (!IP.first.isValid() || Idx < IP.first)
|
||||||
IP.first = Idx;
|
IP.first = Idx;
|
||||||
@ -734,7 +734,7 @@ bool SplitEditor::splitSingleBlocks(const SplitAnalysis::BlockPtrSet &Blocks) {
|
|||||||
for (SplitAnalysis::BlockPtrSet::const_iterator I = Blocks.begin(),
|
for (SplitAnalysis::BlockPtrSet::const_iterator I = Blocks.begin(),
|
||||||
E = Blocks.end(); I != E; ++I) {
|
E = Blocks.end(); I != E; ++I) {
|
||||||
IndexPair &IP = MBBRange[*I];
|
IndexPair &IP = MBBRange[*I];
|
||||||
DEBUG(dbgs() << "Splitting for BB#" << (*I)->getNumber() << ": ["
|
DEBUG(dbgs() << " splitting for BB#" << (*I)->getNumber() << ": ["
|
||||||
<< IP.first << ';' << IP.second << ")\n");
|
<< IP.first << ';' << IP.second << ")\n");
|
||||||
assert(IP.first.isValid() && IP.second.isValid());
|
assert(IP.first.isValid() && IP.second.isValid());
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user