summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-03-03 02:18:00 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-03-03 02:18:00 +0000
commit3fd728596e92492286de5d86cece8805a0eadde1 (patch)
treec0dd446738fdf863c99d289972ed0dd52322bb44 /llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
parent960a54303730a86694934cb89efe9bc501e25b91 (diff)
downloadbcm5719-llvm-3fd728596e92492286de5d86cece8805a0eadde1.tar.gz
bcm5719-llvm-3fd728596e92492286de5d86cece8805a0eadde1.zip
Watch out for cases like this:
entry (0x8b056f0, LLVM BB @0x8b01b30, ID#0): Live Ins: %r0 %r1 %r2 %r3 %reg1032 = tMOVrr %r3<kill> %reg1033 = tMOVri8 1 %reg1034 = tMOVri8 0 tCMPi8 %reg1029<kill>, 0 tBcc mbb<entry,0x8b06a10>, 0 Successors according to CFG: 0x8b06980 0x8b06a10 entry (0x8b06980, LLVM BB @0x8b01b30, ID#12): Predecessors according to CFG: 0x8b056f0 %reg1036 = tMOVrr %reg1034<kill> Successors according to CFG: 0x8b06a10 entry (0x8b06a10, LLVM BB @0x8b01b30, ID#13): Predecessors according to CFG: 0x8b056f0 0x8b06980 %reg1024<dead> = tMOVrr %reg1030<kill> ... reg1030 and r1 have already been joined. When reg1024 and reg1030 are joined, r1 live range from function entry to the tMOVrr instruction are dead. Eliminate r1 from the livein set of the entry BB, not the BB where the copy is. llvm-svn: 34866
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index 26d741f6898..50f1ab061f8 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -938,11 +938,12 @@ bool LiveIntervals::JoinCopy(MachineInstr *CopyMI,
if (JoinIntervals(DestInt, SrcInt)) {
if (isDead) {
// Result of the copy is dead. Propagate this property.
- if (SrcStart == 0 && MRegisterInfo::isPhysicalRegister(repSrcReg)) {
- // Live-in to the function but dead. Remove it from MBB live-in set.
+ if (SrcStart == 0) {
+ assert(MRegisterInfo::isPhysicalRegister(repSrcReg) &&
+ "Live-in must be a physical register!");
+ // Live-in to the function but dead. Remove it from entry live-in set.
// JoinIntervals may end up swapping the two intervals.
- MachineBasicBlock *MBB = CopyMI->getParent();
- MBB->removeLiveIn(repSrcReg);
+ mf_->begin()->removeLiveIn(repSrcReg);
} else {
MachineInstr *SrcMI = getInstructionFromIndex(SrcStart);
if (SrcMI) {
OpenPOWER on IntegriCloud