1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=rewrite-statepoints-for-gc -S < %s | FileCheck %s
4 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
5 target triple = "x86_64-apple-macosx10.11.0"
7 declare i32 @llvm.experimental.deoptimize.i32(...)
8 declare void @llvm.experimental.deoptimize.isVoid(...)
10 define i32 @caller_0(ptr addrspace(1) %ptr) gc "statepoint-example" {
11 ; CHECK-LABEL: @caller_0(
13 ; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @__llvm_deoptimize, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 0, ptr addrspace(1) [[PTR:%.*]]), "gc-live"(ptr addrspace(1) [[PTR]]) ]
14 ; CHECK-NEXT: [[PTR_RELOCATED:%.*]] = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
15 ; CHECK-NEXT: unreachable
18 %v = call i32(...) @llvm.experimental.deoptimize.i32() [ "deopt"(i32 0, ptr addrspace(1) %ptr) ]
23 define i32 @caller_1(ptr addrspace(1) %ptr) gc "statepoint-example" {
24 ; CHECK-LABEL: @caller_1(
26 ; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void (i32, ptr addrspace(1))) @__llvm_deoptimize, i32 2, i32 0, i32 50, ptr addrspace(1) [[PTR:%.*]], i32 0, i32 0) [ "deopt"(i32 0), "gc-live"(ptr addrspace(1) [[PTR]]) ]
27 ; CHECK-NEXT: [[PTR_RELOCATED:%.*]] = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
28 ; CHECK-NEXT: unreachable
31 %v = call i32(...) @llvm.experimental.deoptimize.i32(i32 50, ptr addrspace(1) %ptr) [ "deopt"(i32 0) ]
35 define void @caller_2(ptr addrspace(1) %ptr) gc "statepoint-example" {
36 ; CHECK-LABEL: @caller_2(
38 ; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 2882400000, i32 0, ptr elementtype(void ()) @__llvm_deoptimize, i32 0, i32 0, i32 0, i32 0) [ "deopt"(i32 0, ptr addrspace(1) [[PTR:%.*]]), "gc-live"(ptr addrspace(1) [[PTR]]) ]
39 ; CHECK-NEXT: [[PTR_RELOCATED:%.*]] = call coldcc ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
40 ; CHECK-NEXT: unreachable
43 call void(...) @llvm.experimental.deoptimize.isVoid() [ "deopt"(i32 0, ptr addrspace(1) %ptr) ]