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_x, i32 2
23 merge_here: ; preds = %bump_here_b, %bump_here_a
24 %x = phi i64 addrspace(1)* [ %x_a, %bump_here_a ], [ %x_b, %bump_here_b ]
27 there: ; preds = %entry
28 %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1
31 merge: ; preds = %there, %merge_here
33 ; CHECK: %merged_value.base = phi i64 addrspace(1)* [ %base_obj_x, %merge_here ], [ %base_obj_y, %there ]
34 ; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
35 %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
36 call void @site_for_call_safpeoint() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
37 ret i64 addrspace(1)* %merged_value