2016-01-29 08:28:57 +08:00
|
|
|
; RUN: opt < %s -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
|
2015-02-28 08:20:48 +08:00
|
|
|
|
2015-07-25 03:01:39 +08:00
|
|
|
; CHECK: derived %merged_value base %merged_value.base
|
2015-02-28 08:20:48 +08:00
|
|
|
|
|
|
|
declare void @site_for_call_safpeoint()
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
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" {
|
2015-02-28 08:20:48 +08:00
|
|
|
entry:
|
|
|
|
br i1 %runtime_condition_x, label %here, label %there
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
here: ; preds = %entry
|
|
|
|
br i1 %runtime_condition_y, label %bump_here_a, label %bump_here_b
|
2015-02-28 08:20:48 +08:00
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
bump_here_a: ; preds = %here
|
2015-02-28 08:20:48 +08:00
|
|
|
%x_a = getelementptr i64, i64 addrspace(1)* %base_obj_x, i32 1
|
|
|
|
br label %merge_here
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
bump_here_b: ; preds = %here
|
2015-02-28 08:20:48 +08:00
|
|
|
%x_b = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 2
|
|
|
|
br label %merge_here
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
merge_here: ; preds = %bump_here_b, %bump_here_a
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK: merge_here:
|
2015-07-25 03:01:39 +08:00
|
|
|
; CHECK-DAG: %x.base
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK-DAG: phi i64 addrspace(1)*
|
|
|
|
; CHECK-DAG: [ %base_obj_x, %bump_here_a ]
|
|
|
|
; CHECK-DAG: [ %base_obj_y, %bump_here_b ]
|
2016-01-29 08:28:57 +08:00
|
|
|
%x = phi i64 addrspace(1)* [ %x_a, %bump_here_a ], [ %x_b, %bump_here_b ]
|
2015-02-28 08:20:48 +08:00
|
|
|
br label %merge
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
there: ; preds = %entry
|
2015-02-28 08:20:48 +08:00
|
|
|
%y = getelementptr i64, i64 addrspace(1)* %base_obj_y, i32 1
|
|
|
|
br label %merge
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
merge: ; preds = %there, %merge_here
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK: merge:
|
2015-07-25 03:01:39 +08:00
|
|
|
; CHECK-DAG: %merged_value.base
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK-DAG: phi i64 addrspace(1)*
|
|
|
|
; CHECK-DAG: %merge_here
|
|
|
|
; CHECK-DAG: [ %base_obj_y, %there ]
|
|
|
|
; CHECK: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
|
|
|
|
%merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
|
2016-01-29 08:28:57 +08:00
|
|
|
call void @site_for_call_safpeoint() [ "deopt"(i32 0, i32 -1, i32 0, i32 0, i32 0) ]
|
2015-02-28 08:20:48 +08:00
|
|
|
ret i64 addrspace(1)* %merged_value
|
|
|
|
}
|