It's not safe eliminate copies where src and dst have different sub-register indices.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103450 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng
2010-05-11 00:20:03 +00:00
parent 0bcccac504
commit 31b9c44cc1
4 changed files with 15 additions and 10 deletions

View File

@ -583,7 +583,8 @@ void RAFast::AllocateBasicBlock(MachineBasicBlock &MBB) {
unsigned SrcCopyPhysReg = 0U;
bool isCopy = TII->isMoveInstr(*MI, SrcCopyReg, DstCopyReg,
SrcCopySubReg, DstCopySubReg);
if (isCopy && TargetRegisterInfo::isVirtualRegister(SrcCopyReg))
if (isCopy && SrcCopySubReg == 0 && DstCopySubReg == 0 &&
TargetRegisterInfo::isVirtualRegister(SrcCopyReg))
SrcCopyPhysReg = getVirt2PhysRegMapSlot(SrcCopyReg);
// Loop over the implicit uses, making sure they don't get reallocated.