[llvm] r314338 - Revert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 27 13:34:13 PDT 2017
Author: ctopper
Date: Wed Sep 27 13:34:13 2017
New Revision: 314338
URL: http://llvm.org/viewvc/llvm-project?rev=314338&view=rev
Log:
Revert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo::copyPhysReg."
This contributed to PR34751
Modified:
llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
Modified: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86InstrInfo.cpp?rev=314338&r1=314337&r2=314338&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp Wed Sep 27 13:34:13 2017
@@ -6600,14 +6600,16 @@ void X86InstrInfo::copyPhysReg(MachineBa
else if (X86::GR16RegClass.contains(DestReg, SrcReg))
Opc = X86::MOV16rr;
else if (X86::GR8RegClass.contains(DestReg, SrcReg)) {
- // Copying to or from a physical H register on x86-64 must ensure it
- // doesn't require a REX prefix for the other register.
- if ((isHReg(DestReg) || isHReg(SrcReg)) && Subtarget.is64Bit()) {
+ // Copying to or from a physical H register on x86-64 requires a NOREX
+ // move. Otherwise use a normal move.
+ if ((isHReg(DestReg) || isHReg(SrcReg)) &&
+ Subtarget.is64Bit()) {
+ Opc = X86::MOV8rr_NOREX;
// Both operands must be encodable without an REX prefix.
assert(X86::GR8_NOREXRegClass.contains(SrcReg, DestReg) &&
"8-bit H register can not be copied outside GR8_NOREX");
- }
- Opc = X86::MOV8rr;
+ } else
+ Opc = X86::MOV8rr;
}
else if (X86::VR64RegClass.contains(DestReg, SrcReg))
Opc = X86::MMX_MOVQ64rr;
More information about the llvm-commits
mailing list