diff options
author | Dale Johannesen <dalej@apple.com> | 2010-01-22 22:38:21 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2010-01-22 22:38:21 +0000 |
commit | 1caedd056dbc3eda1537ad8251323bd985819b80 (patch) | |
tree | 83c080731b218768760c43ab1b383651940a8386 | |
parent | f61ed8eb32aa1cfcb440742e6fbaa7c785647131 (diff) | |
download | external_llvm-1caedd056dbc3eda1537ad8251323bd985819b80.zip external_llvm-1caedd056dbc3eda1537ad8251323bd985819b80.tar.gz external_llvm-1caedd056dbc3eda1537ad8251323bd985819b80.tar.bz2 |
Ignore DEBUG_VALUE when building live intervals;
this makes the code work transparently the same
whether they're there or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94240 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/LiveIntervalAnalysis.cpp | 12 | ||||
-rw-r--r-- | lib/CodeGen/SlotIndexes.cpp | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index e0e2ec8..8746bf9 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -140,7 +140,10 @@ void LiveIntervals::printInstrs(raw_ostream &OS) const { << ":\t\t# derived from " << mbbi->getName() << "\n"; for (MachineBasicBlock::iterator mii = mbbi->begin(), mie = mbbi->end(); mii != mie; ++mii) { - OS << getInstructionIndex(mii) << '\t' << *mii; + if (mii->getOpcode()==TargetInstrInfo::DEBUG_VALUE) + OS << SlotIndex::getEmptyKey() << '\t' << *mii; + else + OS << getInstructionIndex(mii) << '\t' << *mii; } } } @@ -672,8 +675,6 @@ void LiveIntervals::computeIntervals() { SlotIndex MIIndex = getMBBStartIdx(MBB); DEBUG(dbgs() << MBB->getName() << ":\n"); - MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end(); - // Create intervals for live-ins to this BB first. for (MachineBasicBlock::const_livein_iterator LI = MBB->livein_begin(), LE = MBB->livein_end(); LI != LE; ++LI) { @@ -689,8 +690,11 @@ void LiveIntervals::computeIntervals() { if (getInstructionFromIndex(MIIndex) == 0) MIIndex = indexes_->getNextNonNullIndex(MIIndex); - for (; MI != miEnd; ++MI) { + for (MachineBasicBlock::iterator MI = MBB->begin(), miEnd = MBB->end(); + MI != miEnd; ++MI) { DEBUG(dbgs() << MIIndex << "\t" << *MI); + if (MI->getOpcode()==TargetInstrInfo::DEBUG_VALUE) + continue; // Handle defs. for (int i = MI->getNumOperands() - 1; i >= 0; --i) { diff --git a/lib/CodeGen/SlotIndexes.cpp b/lib/CodeGen/SlotIndexes.cpp index b8f529b..a23efb2 100644 --- a/lib/CodeGen/SlotIndexes.cpp +++ b/lib/CodeGen/SlotIndexes.cpp @@ -14,6 +14,7 @@ #include "llvm/Support/Debug.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/ManagedStatic.h" +#include "llvm/Target/TargetInstrInfo.h" using namespace llvm; @@ -107,6 +108,8 @@ bool SlotIndexes::runOnMachineFunction(MachineFunction &fn) { for (MachineBasicBlock::iterator miItr = mbb->begin(), miEnd = mbb->end(); miItr != miEnd; ++miItr) { MachineInstr *mi = &*miItr; + if (mi->getOpcode()==TargetInstrInfo::DEBUG_VALUE) + continue; if (miItr == mbb->getFirstTerminator()) { push_back(createEntry(0, index)); |