1 ; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
3 ; CHECK: derived %merged_value base %merged_value.base
5 declare void @site_for_call_safpeoint()
7 define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x,
8 i64 addrspace(1)* %base_obj_y, i1 %runtime_condition_x,
9 i1 %runtime_condition_y) gc "statepoint-example" {
11 br i1 %runtime_condition_x, label %here, label %there
14 br i1 %runtime_condition_y, label %bump_here_a, label %bump_here_b
17 %x_a = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1
21 %x_b = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 2
28 ; CHECK-DAG: phi i64 addrspace(1)*
29 ; CHECK-DAG: [ %base_obj_x, %bump_here_a ]
30 ; CHECK-DAG: [ %base_obj_y, %bump_here_b ]
31 %x = phi i64 addrspace(1)* [ %x_a , %bump_here_a ], [ %x_b , %bump_here_b ]
35 %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1
40 ; CHECK-DAG: %merged_value.base
41 ; CHECK-DAG: phi i64 addrspace(1)*
42 ; CHECK-DAG: %merge_here
43 ; CHECK-DAG: [ %base_obj_y, %there ]
44 ; CHECK: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
45 %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
47 %safepoint_token = call i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
48 ret i64 addrspace(1)* %merged_value
51 declare void @do_safepoint()
52 declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)