Fix a -join-globalcopies bug; handle undef operands.
authorAndrew Trick <atrick@apple.com>
Fri, 21 Jun 2013 18:33:11 +0000 (18:33 +0000)
committerAndrew Trick <atrick@apple.com>
Fri, 21 Jun 2013 18:33:11 +0000 (18:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184569 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/RegisterCoalescer.cpp

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