Home | History | Annotate | Download | only in RewriteStatepointsForGC
      1 ; RUN: opt %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
      2 
      3 ; CHECK: Base Pairs (w/o Relocation):
      4 ; CHECK-DAG: derived %next base %next.base
      5 ; CHECK-DAG: derived %next_x base %base_obj_x
      6 ; CHECK-DAG: derived %next_y base %base_obj_y
      7 
      8 declare i1 @runtime_value()
      9 declare void @do_safepoint()
     10 
     11 define void @select_of_phi(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y) gc "statepoint-example" {
     12 entry:
     13   br label %loop
     14 
     15 loop:
     16   %current_x = phi i64 addrspace(1)* [ %base_obj_x , %entry ], [ %next_x, %merge ]
     17   %current_y = phi i64 addrspace(1)* [ %base_obj_y , %entry ], [ %next_y, %merge ]
     18   %current = phi i64 addrspace(1)* [ null , %entry ], [ %next , %merge ]
     19 
     20   %condition = call i1 @runtime_value()
     21   %next_x = getelementptr i64, i64 addrspace(1)* %current_x, i32 1
     22   %next_y = getelementptr i64, i64 addrspace(1)* %current_y, i32 1
     23 
     24   br i1 %condition, label %true, label %false
     25 
     26 true:
     27   br label %merge
     28 
     29 false:
     30   br label %merge
     31 
     32 merge:
     33   %next = phi i64 addrspace(1)* [ %next_x, %true ], [ %next_y, %false ]
     34   %safepoint_token = call i32 (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
     35   br label %loop
     36 }
     37 
     38 declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
     39