1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-linux-generic < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
6 ; We can't create a select of two TargetFrameIndices since the rest
7 ; of the backend doesn't know how to handle such a construct.
8 define i32 addrspace(1)* @test(i32 addrspace(1)* %a, i32 addrspace(1)* %b, i1 %which) gc "statepoint-example" {
10 ; CHECK: # %bb.0: # %entry
11 ; CHECK-NEXT: pushq %rbx
12 ; CHECK-NEXT: .cfi_def_cfa_offset 16
13 ; CHECK-NEXT: subq $16, %rsp
14 ; CHECK-NEXT: .cfi_def_cfa_offset 32
15 ; CHECK-NEXT: .cfi_offset %rbx, -16
16 ; CHECK-NEXT: movl %edx, %ebx
17 ; CHECK-NEXT: movq %rdi, (%rsp)
18 ; CHECK-NEXT: movq %rsi, {{[0-9]+}}(%rsp)
21 ; CHECK-NEXT: testb $1, %bl
22 ; CHECK-NEXT: je .LBB0_1
23 ; CHECK-NEXT: # %bb.2: # %entry
24 ; CHECK-NEXT: movq (%rsp), %rax
25 ; CHECK-NEXT: jmp .LBB0_3
26 ; CHECK-NEXT: .LBB0_1:
27 ; CHECK-NEXT: movq {{[0-9]+}}(%rsp), %rax
28 ; CHECK-NEXT: .LBB0_3: # %entry
29 ; CHECK-NEXT: addq $16, %rsp
30 ; CHECK-NEXT: .cfi_def_cfa_offset 16
31 ; CHECK-NEXT: popq %rbx
32 ; CHECK-NEXT: .cfi_def_cfa_offset 8
35 %tok = tail call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @f, i32 0, i32 0, i32 0, i32 0, i32 addrspace(1)* %a, i32 addrspace(1)* %b)
36 %a.r = tail call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 7, i32 7) ; (%a, %a)
37 %b.r = tail call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 8, i32 8) ; (%b, %b)
38 %cond.v = select i1 %which, i8 addrspace(1)* %a.r, i8 addrspace(1)* %b.r
39 %cond = bitcast i8 addrspace(1)* %cond.v to i32 addrspace(1)*
40 ret i32 addrspace(1)* %cond
44 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
45 declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)