1 ; RUN: opt -passes=rewrite-statepoints-for-gc -rs4gc-allow-statepoint-with-no-deopt-info=0 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-REQUIRE-DEOPT
2 ; RUN: opt -passes=rewrite-statepoints-for-gc -rs4gc-allow-statepoint-with-no-deopt-info=1 -S < %s | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-NO-REQUIRE-DEOPT
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 void @llvm.memcpy.element.unordered.atomic.p1.p1.i32(ptr addrspace(1), ptr addrspace(1), i32, i32 immarg)
8 declare void @llvm.memmove.element.unordered.atomic.p1.p1.i32(ptr addrspace(1), ptr addrspace(1), i32, i32 immarg)
10 define void @test_memcpy_no_deopt(ptr addrspace(1) %src, i64 %src_offset, ptr addrspace(1) %dest, i64 %dest_offset, i32 %len) gc "statepoint-example" {
11 ; CHECK-LABEL: @test_memcpy_no_deopt
12 ; CHECK-REQUIRE-DEOPT-NOT: @llvm.experimental.gc.statepoint
13 ; CHECK-NO-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
15 %src_derived = getelementptr inbounds i8, ptr addrspace(1) %src, i64 %src_offset
16 %dest_derived = getelementptr inbounds i8, ptr addrspace(1) %dest, i64 %dest_offset
17 call void @llvm.memcpy.element.unordered.atomic.p1.p1.i32(ptr addrspace(1) align 16 %src_derived, ptr addrspace(1) align 16 %dest_derived, i32 %len, i32 1)
21 define void @test_memmove_no_deopt(ptr addrspace(1) %src, i64 %src_offset, ptr addrspace(1) %dest, i64 %dest_offset, i32 %len) gc "statepoint-example" {
22 ; CHECK-LABEL: @test_memmove_no_deopt
23 ; CHECK-REQUIRE-DEOPT-NOT: @llvm.experimental.gc.statepoint
24 ; CHECK-NO-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
26 %src_derived = getelementptr inbounds i8, ptr addrspace(1) %src, i64 %src_offset
27 %dest_derived = getelementptr inbounds i8, ptr addrspace(1) %dest, i64 %dest_offset
28 call void @llvm.memmove.element.unordered.atomic.p1.p1.i32(ptr addrspace(1) align 16 %src_derived, ptr addrspace(1) align 16 %dest_derived, i32 %len, i32 1)
32 define void @test_memcpy_with_deopt(ptr addrspace(1) %src, i64 %src_offset, ptr addrspace(1) %dest, i64 %dest_offset, i32 %len) gc "statepoint-example" {
33 ; CHECK-LABEL: @test_memcpy_with_deopt
34 ; CHECK-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
35 ; CHECK-NO-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
37 %src_derived = getelementptr inbounds i8, ptr addrspace(1) %src, i64 %src_offset
38 %dest_derived = getelementptr inbounds i8, ptr addrspace(1) %dest, i64 %dest_offset
39 call void @llvm.memcpy.element.unordered.atomic.p1.p1.i32(ptr addrspace(1) align 16 %src_derived, ptr addrspace(1) align 16 %dest_derived, i32 %len, i32 1) [ "deopt"(i32 0) ]
43 define void @test_memmove_with_deopt(ptr addrspace(1) %src, i64 %src_offset, ptr addrspace(1) %dest, i64 %dest_offset, i32 %len) gc "statepoint-example" {
44 ; CHECK-LABEL: @test_memmove_with_deopt
45 ; CHECK-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
46 ; CHECK-NO-REQUIRE-DEOPT: @llvm.experimental.gc.statepoint
48 %src_derived = getelementptr inbounds i8, ptr addrspace(1) %src, i64 %src_offset
49 %dest_derived = getelementptr inbounds i8, ptr addrspace(1) %dest, i64 %dest_offset
50 call void @llvm.memmove.element.unordered.atomic.p1.p1.i32(ptr addrspace(1) align 16 %src_derived, ptr addrspace(1) align 16 %dest_derived, i32 %len, i32 1) [ "deopt"(i32 0) ]