Fix a -join-globalcopies bug; handle undef operands.

llvm-svn: 184569
This commit is contained in:
Andrew Trick 2013-06-21 18:33:11 +00:00
parent b7588112b7
commit a02d09e36a

View File

@ -2072,6 +2072,9 @@ static bool isLocalCopy(MachineInstr *Copy, const LiveIntervals *LIS) {
if (!Copy->isCopy()) if (!Copy->isCopy())
return false; return false;
if (Copy->getOperand(1).isUndef())
return false;
unsigned SrcReg = Copy->getOperand(1).getReg(); unsigned SrcReg = Copy->getOperand(1).getReg();
unsigned DstReg = Copy->getOperand(0).getReg(); unsigned DstReg = Copy->getOperand(0).getReg();
if (TargetRegisterInfo::isPhysicalRegister(SrcReg) if (TargetRegisterInfo::isPhysicalRegister(SrcReg)