37 lines · plain
1; RUN: llc -mtriple=x86_64-windows -show-mc-encoding < %s | FileCheck %s2 3; The Win64 ABI wants tail jmps to use a REX_W prefix so it can distinguish4; in-function jumps from function exiting jumps.5 6define void @tail_jmp_reg(i32, i32, ptr %fptr) {7 tail call void () %fptr()8 ret void9}10 11; Check that we merge the REX prefixes into 0x49 instead of 0x48, 0x41.12 13; CHECK-LABEL: tail_jmp_reg:14; CHECK: rex64 jmpq *%r815; CHECK: encoding: [0x49,0xff,0xe0]16 17declare void @tail_tgt()18 19define void @tail_jmp_imm() {20 tail call void @tail_tgt()21 ret void22}23 24; CHECK-LABEL: tail_jmp_imm:25; CHECK: jmp tail_tgt26 27@g_fptr = global ptr @tail_tgt28 29define void @tail_jmp_mem() {30 %fptr = load ptr, ptr @g_fptr31 tail call void () %fptr()32 ret void33}34 35; CHECK-LABEL: tail_jmp_mem:36; CHECK: rex64 jmpq *g_fptr(%rip)37