Index: lib/CodeGen/TwoAddressInstructionPass.cpp =================================================================== --- lib/CodeGen/TwoAddressInstructionPass.cpp +++ lib/CodeGen/TwoAddressInstructionPass.cpp @@ -1586,7 +1586,8 @@ RemovedKillFlag = true; } MO.setReg(LastCopiedReg); - MO.setSubReg(MO.getSubReg()); + if (SubRegB) + MO.setSubReg(0); } } }