diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-02-09 17:20:11 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-02-09 17:20:11 +0000 |
commit | d19418d112d38f81041682aa9c9f57ce14cebd06 (patch) | |
tree | dc620f702f9252443d7c83616d43f79ce924b77d /llvm/lib/CodeGen | |
parent | bd9e50fc912347f485d1114ebf698dd2acef4974 (diff) | |
download | bcm5719-llvm-d19418d112d38f81041682aa9c9f57ce14cebd06.tar.gz bcm5719-llvm-d19418d112d38f81041682aa9c9f57ce14cebd06.zip |
Remember to update live-in lists when coalescing physregs.
Patch by M Wahab!
llvm-svn: 95668
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 27d429b999e..edc56530c2e 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -1755,6 +1755,23 @@ bool SimpleRegisterCoalescing::JoinCopy(CopyRec &TheCopy, bool &Again) { UpdateRegDefsUses(SrcReg, DstReg, SubIdx); + // If we have extended the live range of a physical register, make sure we + // update live-in lists as well. + if (TargetRegisterInfo::isPhysicalRegister(DstReg)) { + const LiveInterval &VRegInterval = li_->getInterval(SrcReg); + SmallVector<MachineBasicBlock*, 16> BlockSeq; + for (LiveInterval::const_iterator I = VRegInterval.begin(), + E = VRegInterval.end(); I != E; ++I ) { + li_->findLiveInMBBs(I->start, I->end, BlockSeq); + for (unsigned idx = 0, size = BlockSeq.size(); idx != size; ++idx) { + MachineBasicBlock &block = *BlockSeq[idx]; + if (!block.isLiveIn(DstReg)) + block.addLiveIn(DstReg); + } + BlockSeq.clear(); + } + } + // SrcReg is guarateed to be the register whose live interval that is // being merged. li_->removeInterval(SrcReg); |