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 @foo()
|
|
|
|
|
|
|
|
define i64 addrspace(1)* @test(i64 addrspace(1)* %base_obj_x, i64 addrspace(1)* %base_obj_y, i1 %runtime_condition) gc "statepoint-example" {
|
|
|
|
entry:
|
|
|
|
br i1 %runtime_condition, label %here, label %there
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
here: ; preds = %entry
|
2015-02-28 08:20:48 +08:00
|
|
|
br label %bump
|
|
|
|
|
2016-01-29 08:28:57 +08:00
|
|
|
bump: ; preds = %here
|
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, %bump
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK: merge:
|
2015-07-25 03:01:39 +08:00
|
|
|
; CHECK: %merged_value.base = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %base_obj_y, %there ]
|
2015-02-28 08:20:48 +08:00
|
|
|
; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
|
|
|
|
%merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
|
2016-01-29 08:28:57 +08:00
|
|
|
call void @foo() [ "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
|
|
|
|
}
|