• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 ; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
2 
3 ; CHECK: derived %merged_value base %merged_value.base
4 
5 declare void @foo()
6 
7 define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition) gc "statepoint-example" {
8 entry:
9   br i1 %runtime_condition, label %here, label %there
10 
11 here:
12   br label %bump
13 
14 bump:
15   br label %merge
16 
17 there:
18   %y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1
19   br label %merge
20 
21 merge:
22 ; CHECK: merge:
23 ; CHECK:  %merged_value.base = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %base_obj_y, %there ]
24 ; CHECK-NEXT:  %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
25   %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
26   %safepoint_token = call i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
27   ret i64 addrspace(1)* %merged_value
28 }
29 
30 declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
31