1 ; RUN: opt < %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
2 ; RUN: opt < %s -passes=rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
4 ; CHECK: derived %merged_value base %merged_value.base
6 declare void @site_for_call_safpeoint()
8 define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition_x, i1 %runtime_condition_y) gc "statepoint-example" {
10 br i1 %runtime_condition_x, label %here, label %there
12 here: ; preds = %entry
13 br i1 %runtime_condition_y, label %bump_here_a, label %bump_here_b
15 bump_here_a: ; preds = %here
16 %x_a = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1
19 bump_here_b: ; preds = %here
20 %x_b = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 2
23 merge_here: ; preds = %bump_here_b, %bump_here_a
26 ; CHECK-DAG: phi i64 addrspace(1)*
27 ; CHECK-DAG: [ %base_obj_x, %bump_here_a ]
28 ; CHECK-DAG: [ %base_obj_y, %bump_here_b ]
29 %x = phi i64 addrspace(1)* [ %x_a, %bump_here_a ], [ %x_b, %bump_here_b ]
32 there: ; preds = %entry
33 %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1
36 merge: ; preds = %there, %merge_here
38 ; CHECK-DAG: %merged_value.base
39 ; CHECK-DAG: phi i64 addrspace(1)*
40 ; CHECK-DAG: %merge_here
41 ; CHECK-DAG: [ %base_obj_y, %there ]
42 ; CHECK: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
43 %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
44 call void @site_for_call_safpeoint() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
45 ret i64 addrspace(1)* %merged_value