Fix PR16508.
[oota-llvm.git] / 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)