1 ; RUN: opt -safepoint-ir-verifier-print-only -passes='verify<safepoint-ir>' -S %s 2>&1 | FileCheck %s
3 ; CHECK-LABEL: Verifying gc pointers in function: test
4 ; CHECK: No illegal uses found by SafepointIRVerifier in: test_gc_relocate
5 define ptr addrspace(1) @test_gc_relocate(i1 %arg) gc "statepoint-example" {
9 bb2: ; preds = %bb8, %bb
10 %tmp = phi ptr addrspace(1) [ %tmp5.relocated, %bb8 ], [ null, %bb ]
11 %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @widget, i32 0, i32 0, i32 0, i32 0) [ "deopt"() ]
14 bb4: ; preds = %bb8, %bb2
15 %tmp5 = phi ptr addrspace(1) [ %tmp5.relocated, %bb8 ], [ %tmp, %bb2 ]
16 %statepoint_token1 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(i1 ()) @baz, i32 0, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %tmp5), "gc-live"(ptr addrspace(1) %tmp5) ]
17 %tmp62 = call i1 @llvm.experimental.gc.result.i1(token %statepoint_token1)
18 %tmp5.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token1, i32 0, i32 0) ; (%tmp5, %tmp5)
19 br i1 %tmp62, label %bb8, label %bb6
22 ret ptr addrspace(1) null
25 br i1 %arg, label %bb4, label %bb2
28 ; CHECK-LABEL: Verifying gc pointers in function: test
29 ; CHECK: No illegal uses found by SafepointIRVerifier in: test_freeze_inst
30 define void @test_freeze_inst(ptr %ptr) gc "statepoint-example" {
35 %vptr = phi ptr addrspace(1) [ %fptr, %loop ], [ undef, %entry ]
36 %fptr = freeze ptr addrspace(1) %vptr
37 %statepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) undef, i32 0, i32 0, i32 0, i32 0) [ "deopt"(ptr addrspace(1) %fptr), "gc-live"(ptr addrspace(1) %fptr) ]
38 %fptr.relocated = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %statepoint_token, i32 0, i32 0) ; (%fptr, %fptr)
42 declare void @widget()
45 declare token @llvm.experimental.gc.statepoint.p0(i64 immarg, i32 immarg, ptr, i32 immarg, i32 immarg, ...)
46 declare i1 @llvm.experimental.gc.result.i1(token)
47 declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32 immarg, i32 immarg)