Skip to content

Commit

Permalink
Revert r314248 "[X86] Don't emit X86::MOV8rr_NOREX from X86InstrInfo:…
Browse files Browse the repository at this point in the history
…:copyPhysReg."

This contributed to PR34751

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314338 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Sep 27, 2017
1 parent 3e68c7d commit b0991e0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/Target/X86/X86InstrInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6600,14 +6600,16 @@ void X86InstrInfo::copyPhysReg(MachineBasicBlock &MBB,
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;
Expand Down

0 comments on commit b0991e0

Please sign in to comment.