summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2012-04-03 00:28:46 +0000
committerPete Cooper <peter_cooper@apple.com>2012-04-03 00:28:46 +0000
commit4f0dbb27d930773cc9f0aef23d247e74a5f96ba2 (patch)
tree28197b2ee01c5115370a469fbca2a7541b81dc99 /llvm/lib
parentb75f4e5e9b1852274e8b01bb38c6151a18fbaee3 (diff)
downloadbcm5719-llvm-4f0dbb27d930773cc9f0aef23d247e74a5f96ba2.tar.gz
bcm5719-llvm-4f0dbb27d930773cc9f0aef23d247e74a5f96ba2.zip
Fixes to r153903. Added missing explanation of behaviour when the VirtRegMap is NULL. Also changed it in this case to just avoid updating the map, but live ranges or intervals will still get updated and created
llvm-svn: 153914
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/LiveRangeEdit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/LiveRangeEdit.cpp b/llvm/lib/CodeGen/LiveRangeEdit.cpp
index 52e366cb7d4..4ecb2d9a60a 100644
--- a/llvm/lib/CodeGen/LiveRangeEdit.cpp
+++ b/llvm/lib/CodeGen/LiveRangeEdit.cpp
@@ -33,8 +33,10 @@ void LiveRangeEdit::Delegate::anchor() { }
LiveInterval &LiveRangeEdit::createFrom(unsigned OldReg) {
unsigned VReg = MRI.createVirtualRegister(MRI.getRegClass(OldReg));
- VRM->grow();
- VRM->setIsSplitFromReg(VReg, VRM->getOriginal(OldReg));
+ if (VRM) {
+ VRM->grow();
+ VRM->setIsSplitFromReg(VReg, VRM->getOriginal(OldReg));
+ }
LiveInterval &LI = LIS.getOrCreateInterval(VReg);
newRegs_.push_back(&LI);
return LI;
@@ -270,8 +272,6 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead,
delegate_->LRE_WillShrinkVirtReg(LI->reg);
if (!LIS.shrinkToUses(LI, &Dead))
continue;
- if (!VRM)
- continue;
// Don't create new intervals for a register being spilled.
// The new intervals would have to be spilled anyway so its not worth it.
@@ -295,7 +295,7 @@ void LiveRangeEdit::eliminateDeadDefs(SmallVectorImpl<MachineInstr*> &Dead,
if (NumComp <= 1)
continue;
++NumFracRanges;
- bool IsOriginal = VRM->getOriginal(LI->reg) == LI->reg;
+ bool IsOriginal = VRM && VRM->getOriginal(LI->reg) == LI->reg;
DEBUG(dbgs() << NumComp << " components: " << *LI << '\n');
SmallVector<LiveInterval*, 8> Dups(1, LI);
for (unsigned i = 1; i != NumComp; ++i) {
OpenPOWER on IntegriCloud