brintos

brintos / llvm-project-archived public Read only

0
0
Text · 15.6 KiB · 65cd1ed Raw
397 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=x86_64-linux | FileCheck %s --check-prefix=LINUX3; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=x86_64-linux-gnux32 | FileCheck %s --check-prefix=LINUX-X324; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=x86_64-windows | FileCheck %s --check-prefix=WINDOWS5; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=x86_64-uefi | FileCheck %s --check-prefix=WINDOWS6; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=i686-windows | FileCheck %s --check-prefix=X86 --check-prefix=X86-NOSSE7; RUN: llc -verify-machineinstrs < %s -enable-tail-merge=0 -mtriple=i686-windows -mattr=+sse2 | FileCheck %s --check-prefix=X86 --check-prefix=X86-SSE8 9; Test that we actually spill and reload all arguments in the variadic argument10; pack. Doing a normal call will clobber all argument registers, and we will11; spill around it. A simple adjustment should not require any XMM spills.12 13declare void @llvm.va_start(ptr) nounwind14 15declare ptr @get_f(ptr %this)16 17define void @f_thunk(ptr %this, ...) {18  ; Use va_start so that we exercise the combination.19; LINUX-LABEL: f_thunk:20; LINUX:       # %bb.0:21; LINUX-NEXT:    pushq %rbp22; LINUX-NEXT:    .cfi_def_cfa_offset 1623; LINUX-NEXT:    pushq %r1524; LINUX-NEXT:    .cfi_def_cfa_offset 2425; LINUX-NEXT:    pushq %r1426; LINUX-NEXT:    .cfi_def_cfa_offset 3227; LINUX-NEXT:    pushq %r1328; LINUX-NEXT:    .cfi_def_cfa_offset 4029; LINUX-NEXT:    pushq %r1230; LINUX-NEXT:    .cfi_def_cfa_offset 4831; LINUX-NEXT:    pushq %rbx32; LINUX-NEXT:    .cfi_def_cfa_offset 5633; LINUX-NEXT:    subq $360, %rsp # imm = 0x16834; LINUX-NEXT:    .cfi_def_cfa_offset 41635; LINUX-NEXT:    .cfi_offset %rbx, -5636; LINUX-NEXT:    .cfi_offset %r12, -4837; LINUX-NEXT:    .cfi_offset %r13, -4038; LINUX-NEXT:    .cfi_offset %r14, -3239; LINUX-NEXT:    .cfi_offset %r15, -2440; LINUX-NEXT:    .cfi_offset %rbp, -1641; LINUX-NEXT:    movb %al, {{[-0-9]+}}(%r{{[sb]}}p) # 1-byte Spill42; LINUX-NEXT:    movaps %xmm7, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill43; LINUX-NEXT:    movaps %xmm6, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill44; LINUX-NEXT:    movaps %xmm5, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill45; LINUX-NEXT:    movaps %xmm4, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill46; LINUX-NEXT:    movaps %xmm3, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill47; LINUX-NEXT:    movaps %xmm2, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill48; LINUX-NEXT:    movaps %xmm1, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill49; LINUX-NEXT:    movaps %xmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill50; LINUX-NEXT:    movq %r9, %r1451; LINUX-NEXT:    movq %r8, %r1552; LINUX-NEXT:    movq %rcx, %r1253; LINUX-NEXT:    movq %rdx, %r1354; LINUX-NEXT:    movq %rsi, %rbp55; LINUX-NEXT:    movq %rdi, %rbx56; LINUX-NEXT:    movq %rsi, {{[0-9]+}}(%rsp)57; LINUX-NEXT:    movq %rdx, {{[0-9]+}}(%rsp)58; LINUX-NEXT:    movq %rcx, {{[0-9]+}}(%rsp)59; LINUX-NEXT:    movq %r8, {{[0-9]+}}(%rsp)60; LINUX-NEXT:    movq %r9, {{[0-9]+}}(%rsp)61; LINUX-NEXT:    testb %al, %al62; LINUX-NEXT:    je .LBB0_263; LINUX-NEXT:  # %bb.1:64; LINUX-NEXT:    movaps %xmm0, {{[0-9]+}}(%rsp)65; LINUX-NEXT:    movaps %xmm1, {{[0-9]+}}(%rsp)66; LINUX-NEXT:    movaps %xmm2, {{[0-9]+}}(%rsp)67; LINUX-NEXT:    movaps %xmm3, {{[0-9]+}}(%rsp)68; LINUX-NEXT:    movaps %xmm4, {{[0-9]+}}(%rsp)69; LINUX-NEXT:    movaps %xmm5, {{[0-9]+}}(%rsp)70; LINUX-NEXT:    movaps %xmm6, {{[0-9]+}}(%rsp)71; LINUX-NEXT:    movaps %xmm7, {{[0-9]+}}(%rsp)72; LINUX-NEXT:  .LBB0_2:73; LINUX-NEXT:    leaq {{[0-9]+}}(%rsp), %rax74; LINUX-NEXT:    movq %rax, {{[0-9]+}}(%rsp)75; LINUX-NEXT:    leaq {{[0-9]+}}(%rsp), %rax76; LINUX-NEXT:    movq %rax, {{[0-9]+}}(%rsp)77; LINUX-NEXT:    movabsq $206158430216, %rax # imm = 0x300000000878; LINUX-NEXT:    movq %rax, {{[0-9]+}}(%rsp)79; LINUX-NEXT:    callq get_f@PLT80; LINUX-NEXT:    movq %rax, %r1181; LINUX-NEXT:    movq %rbx, %rdi82; LINUX-NEXT:    movq %rbp, %rsi83; LINUX-NEXT:    movq %r13, %rdx84; LINUX-NEXT:    movq %r12, %rcx85; LINUX-NEXT:    movq %r15, %r886; LINUX-NEXT:    movzbl {{[-0-9]+}}(%r{{[sb]}}p), %eax # 1-byte Folded Reload87; LINUX-NEXT:    movq %r14, %r988; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm0 # 16-byte Reload89; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm1 # 16-byte Reload90; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm2 # 16-byte Reload91; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm3 # 16-byte Reload92; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm4 # 16-byte Reload93; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm5 # 16-byte Reload94; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm6 # 16-byte Reload95; LINUX-NEXT:    movaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm7 # 16-byte Reload96; LINUX-NEXT:    addq $360, %rsp # imm = 0x16897; LINUX-NEXT:    .cfi_def_cfa_offset 5698; LINUX-NEXT:    popq %rbx99; LINUX-NEXT:    .cfi_def_cfa_offset 48100; LINUX-NEXT:    popq %r12101; LINUX-NEXT:    .cfi_def_cfa_offset 40102; LINUX-NEXT:    popq %r13103; LINUX-NEXT:    .cfi_def_cfa_offset 32104; LINUX-NEXT:    popq %r14105; LINUX-NEXT:    .cfi_def_cfa_offset 24106; LINUX-NEXT:    popq %r15107; LINUX-NEXT:    .cfi_def_cfa_offset 16108; LINUX-NEXT:    popq %rbp109; LINUX-NEXT:    .cfi_def_cfa_offset 8110; LINUX-NEXT:    jmpq *%r11 # TAILCALL111;112; LINUX-X32-LABEL: f_thunk:113; LINUX-X32:       # %bb.0:114; LINUX-X32-NEXT:    pushq %rbp115; LINUX-X32-NEXT:    .cfi_def_cfa_offset 16116; LINUX-X32-NEXT:    pushq %r15117; LINUX-X32-NEXT:    .cfi_def_cfa_offset 24118; LINUX-X32-NEXT:    pushq %r14119; LINUX-X32-NEXT:    .cfi_def_cfa_offset 32120; LINUX-X32-NEXT:    pushq %r13121; LINUX-X32-NEXT:    .cfi_def_cfa_offset 40122; LINUX-X32-NEXT:    pushq %r12123; LINUX-X32-NEXT:    .cfi_def_cfa_offset 48124; LINUX-X32-NEXT:    pushq %rbx125; LINUX-X32-NEXT:    .cfi_def_cfa_offset 56126; LINUX-X32-NEXT:    subl $344, %esp # imm = 0x158127; LINUX-X32-NEXT:    .cfi_def_cfa_offset 400128; LINUX-X32-NEXT:    .cfi_offset %rbx, -56129; LINUX-X32-NEXT:    .cfi_offset %r12, -48130; LINUX-X32-NEXT:    .cfi_offset %r13, -40131; LINUX-X32-NEXT:    .cfi_offset %r14, -32132; LINUX-X32-NEXT:    .cfi_offset %r15, -24133; LINUX-X32-NEXT:    .cfi_offset %rbp, -16134; LINUX-X32-NEXT:    movb %al, {{[-0-9]+}}(%e{{[sb]}}p) # 1-byte Spill135; LINUX-X32-NEXT:    movaps %xmm7, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill136; LINUX-X32-NEXT:    movaps %xmm6, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill137; LINUX-X32-NEXT:    movaps %xmm5, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill138; LINUX-X32-NEXT:    movaps %xmm4, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill139; LINUX-X32-NEXT:    movaps %xmm3, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill140; LINUX-X32-NEXT:    movaps %xmm2, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill141; LINUX-X32-NEXT:    movaps %xmm1, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill142; LINUX-X32-NEXT:    movaps %xmm0, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill143; LINUX-X32-NEXT:    movq %r9, %r14144; LINUX-X32-NEXT:    movq %r8, %r15145; LINUX-X32-NEXT:    movq %rcx, %r12146; LINUX-X32-NEXT:    movq %rdx, %r13147; LINUX-X32-NEXT:    movq %rsi, %rbp148; LINUX-X32-NEXT:    movq %rdi, %rbx149; LINUX-X32-NEXT:    movq %rsi, {{[0-9]+}}(%esp)150; LINUX-X32-NEXT:    movq %rdx, {{[0-9]+}}(%esp)151; LINUX-X32-NEXT:    movq %rcx, {{[0-9]+}}(%esp)152; LINUX-X32-NEXT:    movq %r8, {{[0-9]+}}(%esp)153; LINUX-X32-NEXT:    movq %r9, {{[0-9]+}}(%esp)154; LINUX-X32-NEXT:    testb %al, %al155; LINUX-X32-NEXT:    je .LBB0_2156; LINUX-X32-NEXT:  # %bb.1:157; LINUX-X32-NEXT:    movaps %xmm0, {{[0-9]+}}(%esp)158; LINUX-X32-NEXT:    movaps %xmm1, {{[0-9]+}}(%esp)159; LINUX-X32-NEXT:    movaps %xmm2, {{[0-9]+}}(%esp)160; LINUX-X32-NEXT:    movaps %xmm3, {{[0-9]+}}(%esp)161; LINUX-X32-NEXT:    movaps %xmm4, {{[0-9]+}}(%esp)162; LINUX-X32-NEXT:    movaps %xmm5, {{[0-9]+}}(%esp)163; LINUX-X32-NEXT:    movaps %xmm6, {{[0-9]+}}(%esp)164; LINUX-X32-NEXT:    movaps %xmm7, {{[0-9]+}}(%esp)165; LINUX-X32-NEXT:  .LBB0_2:166; LINUX-X32-NEXT:    leal {{[0-9]+}}(%rsp), %eax167; LINUX-X32-NEXT:    movl %eax, {{[0-9]+}}(%esp)168; LINUX-X32-NEXT:    leal {{[0-9]+}}(%rsp), %eax169; LINUX-X32-NEXT:    movl %eax, {{[0-9]+}}(%esp)170; LINUX-X32-NEXT:    movabsq $206158430216, %rax # imm = 0x3000000008171; LINUX-X32-NEXT:    movq %rax, {{[0-9]+}}(%esp)172; LINUX-X32-NEXT:    callq get_f@PLT173; LINUX-X32-NEXT:    movl %eax, %r11d174; LINUX-X32-NEXT:    movq %rbx, %rdi175; LINUX-X32-NEXT:    movq %rbp, %rsi176; LINUX-X32-NEXT:    movq %r13, %rdx177; LINUX-X32-NEXT:    movq %r12, %rcx178; LINUX-X32-NEXT:    movq %r15, %r8179; LINUX-X32-NEXT:    movzbl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 1-byte Folded Reload180; LINUX-X32-NEXT:    movq %r14, %r9181; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm0 # 16-byte Reload182; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm1 # 16-byte Reload183; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm2 # 16-byte Reload184; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm3 # 16-byte Reload185; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm4 # 16-byte Reload186; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm5 # 16-byte Reload187; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm6 # 16-byte Reload188; LINUX-X32-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm7 # 16-byte Reload189; LINUX-X32-NEXT:    addl $344, %esp # imm = 0x158190; LINUX-X32-NEXT:    .cfi_def_cfa_offset 56191; LINUX-X32-NEXT:    popq %rbx192; LINUX-X32-NEXT:    .cfi_def_cfa_offset 48193; LINUX-X32-NEXT:    popq %r12194; LINUX-X32-NEXT:    .cfi_def_cfa_offset 40195; LINUX-X32-NEXT:    popq %r13196; LINUX-X32-NEXT:    .cfi_def_cfa_offset 32197; LINUX-X32-NEXT:    popq %r14198; LINUX-X32-NEXT:    .cfi_def_cfa_offset 24199; LINUX-X32-NEXT:    popq %r15200; LINUX-X32-NEXT:    .cfi_def_cfa_offset 16201; LINUX-X32-NEXT:    popq %rbp202; LINUX-X32-NEXT:    .cfi_def_cfa_offset 8203; LINUX-X32-NEXT:    jmpq *%r11 # TAILCALL204;205; WINDOWS-LABEL: f_thunk:206; WINDOWS:       # %bb.0:207; WINDOWS-NEXT:    pushq %r14208; WINDOWS-NEXT:    .seh_pushreg %r14209; WINDOWS-NEXT:    pushq %rsi210; WINDOWS-NEXT:    .seh_pushreg %rsi211; WINDOWS-NEXT:    pushq %rdi212; WINDOWS-NEXT:    .seh_pushreg %rdi213; WINDOWS-NEXT:    pushq %rbx214; WINDOWS-NEXT:    .seh_pushreg %rbx215; WINDOWS-NEXT:    subq $72, %rsp216; WINDOWS-NEXT:    .seh_stackalloc 72217; WINDOWS-NEXT:    .seh_endprologue218; WINDOWS-NEXT:    movq %r9, %rsi219; WINDOWS-NEXT:    movq %r8, %rdi220; WINDOWS-NEXT:    movq %rdx, %rbx221; WINDOWS-NEXT:    movq %rcx, %r14222; WINDOWS-NEXT:    movq %rdx, {{[0-9]+}}(%rsp)223; WINDOWS-NEXT:    movq %r8, {{[0-9]+}}(%rsp)224; WINDOWS-NEXT:    movq %r9, {{[0-9]+}}(%rsp)225; WINDOWS-NEXT:    leaq {{[0-9]+}}(%rsp), %rax226; WINDOWS-NEXT:    movq %rax, {{[0-9]+}}(%rsp)227; WINDOWS-NEXT:    callq get_f228; WINDOWS-NEXT:    movq %r14, %rcx229; WINDOWS-NEXT:    movq %rbx, %rdx230; WINDOWS-NEXT:    movq %rdi, %r8231; WINDOWS-NEXT:    movq %rsi, %r9232; WINDOWS-NEXT:    .seh_startepilogue233; WINDOWS-NEXT:    addq $72, %rsp234; WINDOWS-NEXT:    popq %rbx235; WINDOWS-NEXT:    popq %rdi236; WINDOWS-NEXT:    popq %rsi237; WINDOWS-NEXT:    popq %r14238; WINDOWS-NEXT:    .seh_endepilogue239; WINDOWS-NEXT:    rex64 jmpq *%rax # TAILCALL240; WINDOWS-NEXT:    .seh_endproc241;242; X86-NOSSE-LABEL: f_thunk:243; X86-NOSSE:       # %bb.0:244; X86-NOSSE-NEXT:    pushl %ebp245; X86-NOSSE-NEXT:    movl %esp, %ebp246; X86-NOSSE-NEXT:    pushl %esi247; X86-NOSSE-NEXT:    andl $-16, %esp248; X86-NOSSE-NEXT:    subl $32, %esp249; X86-NOSSE-NEXT:    movl 8(%ebp), %esi250; X86-NOSSE-NEXT:    leal 12(%ebp), %eax251; X86-NOSSE-NEXT:    movl %eax, (%esp)252; X86-NOSSE-NEXT:    pushl %esi253; X86-NOSSE-NEXT:    calll _get_f254; X86-NOSSE-NEXT:    addl $4, %esp255; X86-NOSSE-NEXT:    movl %esi, 8(%ebp)256; X86-NOSSE-NEXT:    leal -4(%ebp), %esp257; X86-NOSSE-NEXT:    popl %esi258; X86-NOSSE-NEXT:    popl %ebp259; X86-NOSSE-NEXT:    jmpl *%eax # TAILCALL260;261; X86-SSE-LABEL: f_thunk:262; X86-SSE:       # %bb.0:263; X86-SSE-NEXT:    pushl %ebp264; X86-SSE-NEXT:    movl %esp, %ebp265; X86-SSE-NEXT:    pushl %esi266; X86-SSE-NEXT:    andl $-16, %esp267; X86-SSE-NEXT:    subl $80, %esp268; X86-SSE-NEXT:    movaps %xmm2, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill269; X86-SSE-NEXT:    movaps %xmm1, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill270; X86-SSE-NEXT:    movaps %xmm0, (%esp) # 16-byte Spill271; X86-SSE-NEXT:    movl 8(%ebp), %esi272; X86-SSE-NEXT:    leal 12(%ebp), %eax273; X86-SSE-NEXT:    movl %eax, {{[0-9]+}}(%esp)274; X86-SSE-NEXT:    pushl %esi275; X86-SSE-NEXT:    calll _get_f276; X86-SSE-NEXT:    addl $4, %esp277; X86-SSE-NEXT:    movl %esi, 8(%ebp)278; X86-SSE-NEXT:    movaps (%esp), %xmm0 # 16-byte Reload279; X86-SSE-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm1 # 16-byte Reload280; X86-SSE-NEXT:    movaps {{[-0-9]+}}(%e{{[sb]}}p), %xmm2 # 16-byte Reload281; X86-SSE-NEXT:    leal -4(%ebp), %esp282; X86-SSE-NEXT:    popl %esi283; X86-SSE-NEXT:    popl %ebp284; X86-SSE-NEXT:    jmpl *%eax # TAILCALL285  %ap = alloca [4 x ptr], align 16286  call void @llvm.va_start(ptr %ap)287 288  %fptr = call ptr(ptr) @get_f(ptr %this)289  musttail call void (ptr, ...) %fptr(ptr %this, ...)290  ret void291}292 293; Save and restore 6 GPRs, 8 XMMs, and AL around the call.294 295; No regparms on normal x86 conventions.296 297; This thunk shouldn't require any spills and reloads, assuming the register298; allocator knows what it's doing.299 300define void @g_thunk(ptr %fptr_i8, ...) {301; LINUX-LABEL: g_thunk:302; LINUX:       # %bb.0:303; LINUX-NEXT:    jmpq *%rdi # TAILCALL304;305; LINUX-X32-LABEL: g_thunk:306; LINUX-X32:       # %bb.0:307; LINUX-X32-NEXT:    jmpq *%rdi # TAILCALL308;309; WINDOWS-LABEL: g_thunk:310; WINDOWS:       # %bb.0:311; WINDOWS-NEXT:    rex64 jmpq *%rcx # TAILCALL312;313; X86-LABEL: g_thunk:314; X86:       # %bb.0:315; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax316; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)317; X86-NEXT:    jmpl *%eax # TAILCALL318  musttail call void (ptr, ...) %fptr_i8(ptr %fptr_i8, ...)319  ret void320}321 322; Do a simple multi-exit multi-bb test.323 324%struct.Foo = type { i1, ptr, ptr }325 326@g = external dso_local global i32327 328define void @h_thunk(ptr %this, ...) {329; LINUX-LABEL: h_thunk:330; LINUX:       # %bb.0:331; LINUX-NEXT:    cmpb $1, (%rdi)332; LINUX-NEXT:    jne .LBB2_2333; LINUX-NEXT:  # %bb.1: # %then334; LINUX-NEXT:    movq 8(%rdi), %r11335; LINUX-NEXT:    jmpq *%r11 # TAILCALL336; LINUX-NEXT:  .LBB2_2: # %else337; LINUX-NEXT:    movq 16(%rdi), %r11338; LINUX-NEXT:    movl $42, g(%rip)339; LINUX-NEXT:    jmpq *%r11 # TAILCALL340;341; LINUX-X32-LABEL: h_thunk:342; LINUX-X32:       # %bb.0:343; LINUX-X32-NEXT:    cmpb $1, (%edi)344; LINUX-X32-NEXT:    jne .LBB2_2345; LINUX-X32-NEXT:  # %bb.1: # %then346; LINUX-X32-NEXT:    movl 4(%edi), %r11d347; LINUX-X32-NEXT:    movl %edi, %edi348; LINUX-X32-NEXT:    jmpq *%r11 # TAILCALL349; LINUX-X32-NEXT:  .LBB2_2: # %else350; LINUX-X32-NEXT:    movl 8(%edi), %r11d351; LINUX-X32-NEXT:    movl $42, g(%rip)352; LINUX-X32-NEXT:    movl %edi, %edi353; LINUX-X32-NEXT:    jmpq *%r11 # TAILCALL354;355; WINDOWS-LABEL: h_thunk:356; WINDOWS:       # %bb.0:357; WINDOWS-NEXT:    cmpb $1, (%rcx)358; WINDOWS-NEXT:    jne .LBB2_2359; WINDOWS-NEXT:  # %bb.1: # %then360; WINDOWS-NEXT:    movq 8(%rcx), %rax361; WINDOWS-NEXT:    rex64 jmpq *%rax # TAILCALL362; WINDOWS-NEXT:  .LBB2_2: # %else363; WINDOWS-NEXT:    movq 16(%rcx), %rax364; WINDOWS-NEXT:    movl $42, g(%rip)365; WINDOWS-NEXT:    rex64 jmpq *%rax # TAILCALL366;367; X86-LABEL: h_thunk:368; X86:       # %bb.0:369; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax370; X86-NEXT:    cmpb $1, (%eax)371; X86-NEXT:    jne LBB2_2372; X86-NEXT:  # %bb.1: # %then373; X86-NEXT:    movl 4(%eax), %ecx374; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)375; X86-NEXT:    jmpl *%ecx # TAILCALL376; X86-NEXT:  LBB2_2: # %else377; X86-NEXT:    movl 8(%eax), %ecx378; X86-NEXT:    movl $42, _g379; X86-NEXT:    movl %eax, {{[0-9]+}}(%esp)380; X86-NEXT:    jmpl *%ecx # TAILCALL381  %cond = load i1, ptr %this382  br i1 %cond, label %then, label %else383 384then:385  %a_p = getelementptr %struct.Foo, ptr %this, i32 0, i32 1386  %a_i8 = load ptr, ptr %a_p387  musttail call void (ptr, ...) %a_i8(ptr %this, ...)388  ret void389 390else:391  %b_p = getelementptr %struct.Foo, ptr %this, i32 0, i32 2392  %b_i8 = load ptr, ptr %b_p393  store i32 42, ptr @g394  musttail call void (ptr, ...) %b_i8(ptr %this, ...)395  ret void396}397