aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-03 20:29:39 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-02-03 20:29:39 +0000
commitc50f077b065a328a7ce21d97cfc0a21e5059f735 (patch)
treef0ee7fdf4f61eb51ff0dfb04b8e834509f1b37f3 /lib/CodeGen
parent08eb8dd616bb4d4213f2ebda1de56b45bb88b6d9 (diff)
downloadexternal_llvm-c50f077b065a328a7ce21d97cfc0a21e5059f735.zip
external_llvm-c50f077b065a328a7ce21d97cfc0a21e5059f735.tar.gz
external_llvm-c50f077b065a328a7ce21d97cfc0a21e5059f735.tar.bz2
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
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SplitKit.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/CodeGen/SplitKit.cpp b/lib/CodeGen/SplitKit.cpp
index 8bd6280..3ffb079 100644
--- a/lib/CodeGen/SplitKit.cpp
+++ b/lib/CodeGen/SplitKit.cpp
@@ -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.