Do not attempt copy coalescing if the source and dest sub-register indices do not match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103679 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2010-05-12 23:59:42 +00:00
parent 3519f9d7d1
commit de7dea2e44

View File

@ -846,7 +846,8 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
unsigned SrcCopyReg, DstCopyReg, SrcCopySubReg, DstCopySubReg;
unsigned SrcCopyPhysReg = 0U;
bool isCopy = TII->isMoveInstr(*MI, SrcCopyReg, DstCopyReg,
SrcCopySubReg, DstCopySubReg);
SrcCopySubReg, DstCopySubReg) &&
SrcCopySubReg == DstCopySubReg;
if (isCopy && TargetRegisterInfo::isVirtualRegister(SrcCopyReg))
SrcCopyPhysReg = getVirt2PhysRegMapSlot(SrcCopyReg);
@ -1154,7 +1155,8 @@ void RALocal::AllocateBasicBlock(MachineBasicBlock &MBB) {
// the register scavenger. See pr4100.)
if (TII->isMoveInstr(*MI, SrcCopyReg, DstCopyReg,
SrcCopySubReg, DstCopySubReg) &&
SrcCopyReg == DstCopyReg && DeadDefs.empty())
SrcCopyReg == DstCopyReg && SrcCopySubReg == DstCopySubReg &&
DeadDefs.empty())
MBB.erase(MI);
}