diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 00dec66dcaf..681473ba795 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -1434,7 +1434,7 @@ bool TwoAddressInstructionPass::EliminateRegSequences() { IsImpDef = false; // Remember COPY sources. These might be candidate for coalescing. - if (DefMI->isCopy()) + if (DefMI->isCopy() && DefMI->getOperand(1).getSubReg()) RealSrcs.push_back(DefMI->getOperand(1).getReg()); if (!Seen.insert(SrcReg) ||