llvm.org GIT mirror llvm / 99d459d
[RS4GC] Port three tests to the deopt bundles directory two-invokes-one-landingpad.ll was only moved (and not "ported"), but having everything in the `deopt-bundles` directory will make later changes more obvious. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259125 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjoy Das 3 years ago
3 changed file(s) with 72 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: opt < %s -rs4gc-use-deopt-bundles -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
1
2 ; CHECK: derived %select base @global
3
4 @global = external addrspace(1) global i8
5
6 define i8 @test(i1 %cond) gc "statepoint-example" {
7 %derived1 = getelementptr i8, i8 addrspace(1)* @global, i64 1
8 %derived2 = getelementptr i8, i8 addrspace(1)* @global, i64 2
9 %select = select i1 %cond, i8 addrspace(1)* %derived1, i8 addrspace(1)* %derived2
10 call void @extern()
11 ; CHECK-NOT: relocate
12 ; CHECK: %load = load i8, i8 addrspace(1)* %select
13 %load = load i8, i8 addrspace(1)* %select
14 ret i8 %load
15 }
16
17 declare void @extern() gc "statepoint-example"
18
19 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
0 ; RUN: opt < %s -rs4gc-use-deopt-bundles -rewrite-statepoints-for-gc -spp-print-base-pointers -S 2>&1 | FileCheck %s
1
2 ; CHECK: derived %derived base @global
3
4 @global = external addrspace(1) global i8
5
6 define i8 @test(i64 %offset) gc "statepoint-example" {
7 %derived = getelementptr i8, i8 addrspace(1)* @global, i64 %offset
8 call void @extern()
9 ; CHECK-NOT: relocate
10 ; CHECK-NOT: remat
11 ; CHECK: %load = load i8, i8 addrspace(1)* %derived
12 %load = load i8, i8 addrspace(1)* %derived
13 ret i8 %load
14 }
15
16 declare void @extern() gc "statepoint-example"
17
18 declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
0 ; RUN: opt < %s -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles -S | FileCheck %s
1
2 declare void @some_call(i64 addrspace(1)*)
3
4 declare i32 @dummy_personality_function()
5
6 define i64 addrspace(1)* @test(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1)
7 gc "statepoint-example"
8 personality i32 ()* @dummy_personality_function {
9 entry:
10 invoke void @some_call(i64 addrspace(1)* %obj) [ "deopt"() ]
11 to label %second_invoke unwind label %exceptional_return
12
13 second_invoke: ; preds = %entry
14 invoke void @some_call(i64 addrspace(1)* %obj) [ "deopt"() ]
15 to label %normal_return unwind label %exceptional_return
16
17 normal_return: ; preds = %second_invoke
18 ret i64 addrspace(1)* %obj
19
20 ; CHECK: exceptional_return1:
21 ; CHECK-NEXT: %lpad2 = landingpad token
22
23 ; CHECK: exceptional_return.split-lp:
24 ; CHECK-NEXT: %lpad.split-lp = landingpad token
25
26 ; CHECK: exceptional_return:
27 ; CHECK-NOT: phi token
28
29 exceptional_return: ; preds = %second_invoke, %entry
30 %lpad = landingpad token cleanup
31 ret i64 addrspace(1)* %obj1
32 }