llvm.org GIT mirror llvm / b9be004
[FastISel] Move gc intrinsic test to X86 directory Move from generic to X86 directory since gc intrinsics only supposed in X86 64 bit. Add target triple as well. Fixes build failure in i686-linux-RA caused by rL307084. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307086 91177308-0d34-0410-b5e6-96231b3b80d8 Anna Thomas 3 years ago
2 changed file(s) with 57 addition(s) and 55 deletion(s). Raw diff Collapse all Expand all
+0
-55
test/CodeGen/Generic/fast-isel-gc-intrinsics.ll less more
None ; RUN: llc < %s -fast-isel
1
2 ; Dont crash with gc intrinsics.
3
4 ; gcrelocate call should not be an LLVM Machine Block by itself.
5 define i8 addrspace(1)* @test_gcrelocate(i8 addrspace(1)* %v) gc "statepoint-example" {
6 entry:
7 %tok = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
8 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 7, i32 7)
9 ret i8 addrspace(1)* %vnew
10 }
11
12 ; gcresult calls are fine in their own blocks.
13 define i1 @test_gcresult() gc "statepoint-example" {
14 entry:
15 %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0)
16 %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
17 ret i1 %call1
18 }
19
20 ; we are okay here because we see the gcrelocate and avoid generating their own
21 ; block.
22 define i1 @test_gcresult_gcrelocate(i8 addrspace(1)* %v) gc "statepoint-example" {
23 entry:
24 %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
25 %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
26 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 7, i32 7)
27 ret i1 %call1
28 }
29
30 define i8 addrspace(1)* @test_non_entry_block(i8 addrspace(1)* %v, i8 %val) gc "statepoint-example" {
31 entry:
32 %load = load i8, i8 addrspace(1)* %v
33 %cmp = icmp eq i8 %load, %val
34 br i1 %cmp, label %func_call, label %exit
35
36 func_call:
37 call void @dummy()
38 %tok = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
39 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 7, i32 7)
40 ret i8 addrspace(1)* %vnew
41
42 exit:
43 ret i8 addrspace(1)* %v
44
45 }
46
47 declare void @dummy()
48 declare void @foo()
49
50 declare zeroext i1 @return_i1()
51 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
52 declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
53 declare i1 @llvm.experimental.gc.result.i1(token)
54 declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)
0 ; RUN: llc < %s -fast-isel
1
2 target datalayout = "e-i64:64-f80:128-n8:16:32:64-S128"
3 target triple = "x86_64-pc-linux-gnu"
4 ; Dont crash with gc intrinsics.
5
6 ; gcrelocate call should not be an LLVM Machine Block by itself.
7 define i8 addrspace(1)* @test_gcrelocate(i8 addrspace(1)* %v) gc "statepoint-example" {
8 entry:
9 %tok = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
10 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 7, i32 7)
11 ret i8 addrspace(1)* %vnew
12 }
13
14 ; gcresult calls are fine in their own blocks.
15 define i1 @test_gcresult() gc "statepoint-example" {
16 entry:
17 %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0)
18 %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
19 ret i1 %call1
20 }
21
22 ; we are okay here because we see the gcrelocate and avoid generating their own
23 ; block.
24 define i1 @test_gcresult_gcrelocate(i8 addrspace(1)* %v) gc "statepoint-example" {
25 entry:
26 %safepoint_token = tail call token (i64, i32, i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i64 0, i32 0, i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
27 %call1 = call zeroext i1 @llvm.experimental.gc.result.i1(token %safepoint_token)
28 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %safepoint_token, i32 7, i32 7)
29 ret i1 %call1
30 }
31
32 define i8 addrspace(1)* @test_non_entry_block(i8 addrspace(1)* %v, i8 %val) gc "statepoint-example" {
33 entry:
34 %load = load i8, i8 addrspace(1)* %v
35 %cmp = icmp eq i8 %load, %val
36 br i1 %cmp, label %func_call, label %exit
37
38 func_call:
39 call void @dummy()
40 %tok = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @foo, i32 0, i32 0, i32 0, i32 0, i8 addrspace(1)* %v)
41 %vnew = call i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %tok, i32 7, i32 7)
42 ret i8 addrspace(1)* %vnew
43
44 exit:
45 ret i8 addrspace(1)* %v
46
47 }
48
49 declare void @dummy()
50 declare void @foo()
51
52 declare zeroext i1 @return_i1()
53 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
54 declare token @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
55 declare i1 @llvm.experimental.gc.result.i1(token)
56 declare i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token, i32, i32)