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