summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-01-29 00:28:57 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-01-29 00:28:57 +0000
commit0407108020ed12d8c34582d847d2c37cd68d1d0b (patch)
tree7de1975eea25776ce57985fbd3c86e19066e48fb /llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
parentbaf16512ea3187a38b8f7a0298b8c4c2f0741ae5 (diff)
downloadbcm5719-llvm-0407108020ed12d8c34582d847d2c37cd68d1d0b.tar.gz
bcm5719-llvm-0407108020ed12d8c34582d847d2c37cd68d1d0b.zip
[RS4GC] Clamp UseDeoptBundles to true and update tests
The full diff for the test directory may be hard to read because of the filename clash; so here's all that happened as far as the tests are concerned: ``` cd test/Transforms/RewriteStatepointsForGC git rm *ll git mv deopt-bundles/* ./ rmdir deopt-bundles find . -name '*.ll' | xargs gsed -i 's/-rs4gc-use-deopt-bundles //g' ``` llvm-svn: 259129
Diffstat (limited to 'llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll')
-rw-r--r--llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll22
1 files changed, 22 insertions, 0 deletions
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll b/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
new file mode 100644
index 00000000000..1d22626520b
--- /dev/null
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/gc-relocate-creation.ll
@@ -0,0 +1,22 @@
+; RUN: opt < %s -rewrite-statepoints-for-gc -S 2>&1 | FileCheck %s
+
+; This test is to verify gc.relocate can handle pointer to vector of
+; pointers (<2 x i32 addrspace(1)*> addrspace(1)* in this case).
+; The old scheme to create a gc.relocate of <2 x i32 addrspace(1)*> addrspace(1)*
+; type will fail because llvm does not support mangling vector of pointers.
+; The new scheme will create all gc.relocate to i8 addrspace(1)* type and
+; then bitcast to the correct type.
+
+declare void @foo()
+
+declare void @use(...) "gc-leaf-function"
+
+define void @test1(<2 x i32 addrspace(1)*> addrspace(1)* %obj) gc "statepoint-example" {
+entry:
+; CHECK: %obj.relocated = call coldcc i8 addrspace(1)* @llvm.experimental.gc.relocate.p1i8(token %statepoint_token, i32 7, i32 7)
+; CHECK-NEXT: %obj.relocated.casted = bitcast i8 addrspace(1)* %obj.relocated to <2 x i32 addrspace(1)*> addrspace(1)*
+
+ call void @foo() [ "deopt"() ]
+ call void (...) @use(<2 x i32 addrspace(1)*> addrspace(1)* %obj)
+ ret void
+}
OpenPOWER on IntegriCloud