diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-11-15 08:13:29 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-11-15 08:13:29 +0000 |
| commit | 2c1a50455c53b9b58dd0d0b38230be4955c9f5d5 (patch) | |
| tree | 134038b27f8fcada1717822b60571961e9f33117 /llvm/lib/CodeGen | |
| parent | 847bfbcaf08154330792693547cdc20eea18e38a (diff) | |
| download | bcm5719-llvm-2c1a50455c53b9b58dd0d0b38230be4955c9f5d5.tar.gz bcm5719-llvm-2c1a50455c53b9b58dd0d0b38230be4955c9f5d5.zip | |
Fix a thinko in post-allocation coalescer.
llvm-svn: 44166
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 833868a4585..55094e3e5d6 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -168,15 +168,22 @@ bool LiveIntervals::conflictsWithPhysRegDef(const LiveInterval &li, if (index == end) break; MachineInstr *MI = getInstructionFromIndex(index); + unsigned SrcReg, DstReg; + if (tii_->isMoveInstr(*MI, SrcReg, DstReg)) + if (SrcReg == li.reg || DstReg == li.reg) + continue; for (unsigned i = 0; i != MI->getNumOperands(); ++i) { MachineOperand& mop = MI->getOperand(i); - if (!mop.isRegister() || !mop.isDef()) + if (!mop.isRegister()) continue; unsigned PhysReg = mop.getReg(); - if (PhysReg == 0) + if (PhysReg == 0 || PhysReg == li.reg) continue; - if (MRegisterInfo::isVirtualRegister(PhysReg)) + if (MRegisterInfo::isVirtualRegister(PhysReg)) { + if (!vrm.hasPhys(PhysReg)) + continue; PhysReg = vrm.getPhys(PhysReg); + } if (PhysReg && mri_->regsOverlap(PhysReg, reg)) return true; } |

