Index: llvm/trunk/lib/Target/X86/X86ExpandPseudo.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86ExpandPseudo.cpp +++ llvm/trunk/lib/Target/X86/X86ExpandPseudo.cpp @@ -121,7 +121,9 @@ Op = X86::TAILJMPd_CC; break; default: - Op = IsWin64 ? X86::TAILJMPd64_REX : X86::TAILJMPd64; + // Note: Win64 uses REX prefixes indirect jumps out of functions, but + // not direct ones. + Op = X86::TAILJMPd64; break; } MachineInstrBuilder MIB = BuildMI(MBB, MBBI, DL, TII->get(Op)); Index: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp +++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp @@ -24521,7 +24521,6 @@ case X86::TAILJMPd64: case X86::TAILJMPr64: case X86::TAILJMPm64: - case X86::TAILJMPd64_REX: case X86::TAILJMPr64_REX: case X86::TAILJMPm64_REX: llvm_unreachable("TAILJMP64 would not be touched here."); Index: llvm/trunk/lib/Target/X86/X86InstrControl.td =================================================================== --- llvm/trunk/lib/Target/X86/X86InstrControl.td +++ llvm/trunk/lib/Target/X86/X86InstrControl.td @@ -323,11 +323,8 @@ def TAILJMPm64 : I<0xFF, MRM4m, (outs), (ins i64mem_TC:$dst), "jmp{q}\t{*}$dst", [], IIC_JMP_MEM>; - // Win64 wants jumps leaving the function to have a REX_W prefix. + // Win64 wants indirect jumps leaving the function to have a REX_W prefix. let hasREX_WPrefix = 1 in { - def TAILJMPd64_REX : Ii32PCRel<0xE9, RawFrm, (outs), - (ins i64i32imm_pcrel:$dst), - "rex64 jmp\t$dst", [], IIC_JMP_REL>; def TAILJMPr64_REX : I<0xFF, MRM4r, (outs), (ins ptr_rc_tailcall:$dst), "rex64 jmp{q}\t{*}$dst", [], IIC_JMP_MEM>; Index: llvm/trunk/lib/Target/X86/X86InstrInfo.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86InstrInfo.cpp +++ llvm/trunk/lib/Target/X86/X86InstrInfo.cpp @@ -8286,7 +8286,6 @@ case X86::TAILJMPd64: case X86::TAILJMPm64: case X86::TAILJMPr64: - case X86::TAILJMPd64_REX: case X86::TAILJMPm64_REX: case X86::TAILJMPr64_REX: return true; Index: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp @@ -1311,7 +1311,6 @@ case X86::TAILJMPd64: case X86::TAILJMPr64_REX: case X86::TAILJMPm64_REX: - case X86::TAILJMPd64_REX: // Lower these as normal, but add some comments. OutStreamer->AddComment("TAILCALL"); break; Index: llvm/trunk/test/CodeGen/X86/seh-catchpad.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/seh-catchpad.ll +++ llvm/trunk/test/CodeGen/X86/seh-catchpad.ll @@ -173,7 +173,7 @@ ; CHECK: "?filt$0@0@main@@": # @"\01?filt$0@0@main@@" ; CHECK: .seh_proc "?filt$0@0@main@@" ; CHECK: .seh_endprologue -; CHECK: rex64 jmp filt # TAILCALL +; CHECK: jmp filt # TAILCALL ; CHECK: .seh_handlerdata declare i32 @filt() #1 Index: llvm/trunk/test/CodeGen/X86/tail-call-win64.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/tail-call-win64.ll +++ llvm/trunk/test/CodeGen/X86/tail-call-win64.ll @@ -22,7 +22,7 @@ } ; CHECK-LABEL: tail_jmp_imm: -; CHECK: rex64 jmp tail_tgt +; CHECK: jmp tail_tgt @g_fptr = global void ()* @tail_tgt Index: llvm/trunk/test/CodeGen/X86/win64_sibcall.ll =================================================================== --- llvm/trunk/test/CodeGen/X86/win64_sibcall.ll +++ llvm/trunk/test/CodeGen/X86/win64_sibcall.ll @@ -21,7 +21,7 @@ ; WIN_X64: xorl %r8d, %r8d ; WIN_X64: popq %rax -; WIN_X64: rex64 jmp C2 # TAILCALL +; WIN_X64: jmp C2 # TAILCALL ; LINUX: xorl %edx, %edx ; LINUX: jmp C2 # TAILCALL Index: llvm/trunk/test/DebugInfo/COFF/register-variables.ll =================================================================== --- llvm/trunk/test/DebugInfo/COFF/register-variables.ll +++ llvm/trunk/test/DebugInfo/COFF/register-variables.ll @@ -54,7 +54,7 @@ ; ASM: addq $32, %rsp ; ASM: popq %rsi ; ASM: [[func_end:\.Ltmp.*]]: -; ASM: rex64 jmp putint # TAILCALL +; ASM: jmp putint # TAILCALL ; ASM: .short 4414 # Record kind: S_LOCAL ; ASM: .asciz "p"