summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorIgor Laevsky <igmyrj@gmail.com>2015-11-04 01:16:10 +0000
committerIgor Laevsky <igmyrj@gmail.com>2015-11-04 01:16:10 +0000
commit35fe692025ca3e7604c5ca80ae8deb99acd8604e (patch)
tree45e6d5440849ac5db6e4f54f88bb4a46574fc967 /llvm/test
parent24519d98b3151a798157059eec2cc984796fbe03 (diff)
downloadbcm5719-llvm-35fe692025ca3e7604c5ca80ae8deb99acd8604e.tar.gz
bcm5719-llvm-35fe692025ca3e7604c5ca80ae8deb99acd8604e.zip
[StatepointLowering] Remove distinction between call and invoke safepoints
There is no point in having invoke safepoints handled differently than the call safepoints. All relevant decisions could be made by looking at whether or not gc.result and gc.relocate lay in a same basic block. This change will allow to lower call safepoints with relocates and results in a different basic blocks. See test case for example. Differential Revision: http://reviews.llvm.org/D14158 llvm-svn: 252028
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/X86/statepoint-call-lowering.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll
index 8f352b7728c..46d3cafa35b 100644
--- a/llvm/test/CodeGen/X86/statepoint-call-lowering.ll
+++ b/llvm/test/CodeGen/X86/statepoint-call-lowering.ll
@@ -100,6 +100,31 @@ entry:
ret i1 %call1
}
+declare void @consume(i32 addrspace(1)* %obj)
+
+define i1 @test_cross_bb(i32 addrspace(1)* %a, i1 %external_cond) gc "statepoint-example" {
+; CHECK-LABEL: test_cross_bb
+; CHECK: movq
+; CHECK: callq return_i1
+; CHECK: %left
+; CHECK: movq
+; CHECK-NEXT: callq consume
+; CHECK: retq
+entry:
+ %safepoint_token = tail call i32 (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, i32 addrspace(1)* %a)
+ br i1 %external_cond, label %left, label %right
+
+left:
+ %call1 = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 7, i32 7)
+ %call2 = call zeroext i1 @llvm.experimental.gc.result.i1(i32 %safepoint_token)
+ call void @consume(i32 addrspace(1)* %call1)
+ ret i1 %call2
+
+right:
+ ret i1 true
+}
+
+
declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i64, i32, i1 ()*, i32, i32, ...)
declare i1 @llvm.experimental.gc.result.i1(i32)
OpenPOWER on IntegriCloud