diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp index e123ae7e24ac..c0243652bb7b 100644 --- a/llvm/lib/Target/X86/X86InstrInfo.cpp +++ b/llvm/lib/Target/X86/X86InstrInfo.cpp @@ -1664,9 +1664,10 @@ bool X86InstrInfo::copyRegToReg(MachineBasicBlock &MBB, } else if (DestRC == &X86::GR16RegClass) { Opc = X86::MOV16rr; } else if (DestRC == &X86::GR8RegClass) { - // Copying two or from a physical H register requires a NOREX move. - // Otherwise use a normal move. - if (isHReg(DestReg) || isHReg(SrcReg)) + // Copying two or from a physical H register on x86-64 requires a NOREX + // move. Otherwise use a normal move. + if ((isHReg(DestReg) || isHReg(SrcReg)) && + TM.getSubtarget().is64Bit()) Opc = X86::MOV8rr_NOREX; else Opc = X86::MOV8rr;