mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Add debug output and asserts to the phi-connecting code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124813 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
08eb8dd616
commit
c50f077b06
@ -978,16 +978,27 @@ void SplitEditor::finish() {
|
||||
const VNInfo *PHIVNI = *I;
|
||||
if (!PHIVNI->isPHIDef())
|
||||
continue;
|
||||
LiveIntervalMap &LIM = LIMappers[RegAssign.lookup(PHIVNI->def)];
|
||||
unsigned RegIdx = RegAssign.lookup(PHIVNI->def);
|
||||
LiveIntervalMap &LIM = LIMappers[RegIdx];
|
||||
MachineBasicBlock *MBB = LIS.getMBBFromIndex(PHIVNI->def);
|
||||
DEBUG(dbgs() << " map phi in BB#" << MBB->getNumber() << '@' << PHIVNI->def
|
||||
<< " -> " << RegIdx << '\n');
|
||||
for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(),
|
||||
PE = MBB->pred_end(); PI != PE; ++PI) {
|
||||
SlotIndex End = LIS.getMBBEndIdx(*PI).getPrevSlot();
|
||||
DEBUG(dbgs() << " pred BB#" << (*PI)->getNumber() << '@' << End);
|
||||
// The predecessor may not have a live-out value. That is OK, like an
|
||||
// undef PHI operand.
|
||||
if (VNInfo *VNI = Edit.getParent().getVNInfoAt(End))
|
||||
if (VNInfo *VNI = Edit.getParent().getVNInfoAt(End)) {
|
||||
DEBUG(dbgs() << " has parent valno #" << VNI->id << " live out\n");
|
||||
assert(RegAssign.lookup(End) == RegIdx &&
|
||||
"Different register assignment in phi predecessor");
|
||||
LIM.mapValue(VNI, End);
|
||||
}
|
||||
else
|
||||
DEBUG(dbgs() << " is not live-out\n");
|
||||
}
|
||||
DEBUG(dbgs() << " " << *LIM.getLI() << '\n');
|
||||
}
|
||||
|
||||
// Rewrite instructions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user