summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/RewriteStatepointsForGC/live-vector.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/live-vector.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/live-vector.ll')
-rw-r--r--llvm/test/Transforms/RewriteStatepointsForGC/live-vector.ll71
1 files changed, 34 insertions, 37 deletions
diff --git a/llvm/test/Transforms/RewriteStatepointsForGC/live-vector.ll b/llvm/test/Transforms/RewriteStatepointsForGC/live-vector.ll
index 2ec09d6acae..ab84cbc5e52 100644
--- a/llvm/test/Transforms/RewriteStatepointsForGC/live-vector.ll
+++ b/llvm/test/Transforms/RewriteStatepointsForGC/live-vector.ll
@@ -1,20 +1,21 @@
; Test that we can correctly handle vectors of pointers in statepoint
; rewriting. Currently, we scalarize, but that's an implementation detail.
-; RUN: opt %s -rewrite-statepoints-for-gc -rs4gc-split-vector-values -S | FileCheck %s
+; RUN: opt < %s -rewrite-statepoints-for-gc -rs4gc-split-vector-values -S | FileCheck %s
; A non-vector relocation for comparison
+
define i64 addrspace(1)* @test(i64 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-LABEL: test
; CHECK: gc.statepoint
; CHECK-NEXT: gc.relocate
; CHECK-NEXT: bitcast
; CHECK-NEXT: ret i64 addrspace(1)* %obj.relocated.casted
+; A base vector from a argument
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ call void @do_safepoint() [ "deopt"() ]
ret i64 addrspace(1)* %obj
}
-; A base vector from a argument
define <2 x i64 addrspace(1)*> @test2(<2 x i64 addrspace(1)*> %obj) gc "statepoint-example" {
; CHECK-LABEL: test2
; CHECK: extractelement
@@ -27,12 +28,12 @@ define <2 x i64 addrspace(1)*> @test2(<2 x i64 addrspace(1)*> %obj) gc "statepoi
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %7
+; A base vector from a load
entry:
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ call void @do_safepoint() [ "deopt"() ]
ret <2 x i64 addrspace(1)*> %obj
}
-; A base vector from a load
define <2 x i64 addrspace(1)*> @test3(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" {
; CHECK-LABEL: test3
; CHECK: load
@@ -46,15 +47,15 @@ define <2 x i64 addrspace(1)*> @test3(<2 x i64 addrspace(1)*>* %ptr) gc "statepo
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %7
+; When a statepoint is an invoke rather than a call
entry:
%obj = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ call void @do_safepoint() [ "deopt"() ]
ret <2 x i64 addrspace(1)*> %obj
}
declare i32 @fake_personality_function()
-; When a statepoint is an invoke rather than a call
define <2 x i64 addrspace(1)*> @test4(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" personality i32 ()* @fake_personality_function {
; CHECK-LABEL: test4
; CHECK: load
@@ -63,9 +64,10 @@ define <2 x i64 addrspace(1)*> @test4(<2 x i64 addrspace(1)*>* %ptr) gc "statepo
; CHECK-NEXT: gc.statepoint
entry:
%obj = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
- invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ invoke void @do_safepoint() [ "deopt"() ]
to label %normal_return unwind label %exceptional_return
+normal_return: ; preds = %entry
; CHECK-LABEL: normal_return:
; CHECK: gc.relocate
; CHECK-NEXT: bitcast
@@ -73,10 +75,10 @@ entry:
; CHECK-NEXT: bitcast
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
-; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %8
-normal_return: ; preds = %entry
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %7
ret <2 x i64 addrspace(1)*> %obj
+exceptional_return: ; preds = %entry
; CHECK-LABEL: exceptional_return:
; CHECK: gc.relocate
; CHECK-NEXT: bitcast
@@ -84,18 +86,16 @@ normal_return: ; preds = %entry
; CHECK-NEXT: bitcast
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
-; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %14
-exceptional_return: ; preds = %entry
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %13
+; Can we handle an insert element with a constant offset? This effectively
+; tests both the equal and inequal case since we have to relocate both indices
+; in the vector.
%landing_pad4 = landingpad token
cleanup
ret <2 x i64 addrspace(1)*> %obj
}
-; Can we handle an insert element with a constant offset? This effectively
-; tests both the equal and inequal case since we have to relocate both indices
-; in the vector.
-define <2 x i64 addrspace(1)*> @test5(i64 addrspace(1)* %p)
- gc "statepoint-example" {
+define <2 x i64 addrspace(1)*> @test5(i64 addrspace(1)* %p) gc "statepoint-example" {
; CHECK-LABEL: test5
; CHECK: insertelement
; CHECK-NEXT: extractelement
@@ -108,17 +108,27 @@ define <2 x i64 addrspace(1)*> @test5(i64 addrspace(1)* %p)
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %7
+; A base vector from a load
entry:
%vec = insertelement <2 x i64 addrspace(1)*> undef, i64 addrspace(1)* %p, i32 0
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ call void @do_safepoint() [ "deopt"() ]
ret <2 x i64 addrspace(1)*> %vec
}
-
-; A base vector from a load
-define <2 x i64 addrspace(1)*> @test6(i1 %cnd, <2 x i64 addrspace(1)*>* %ptr)
- gc "statepoint-example" {
+define <2 x i64 addrspace(1)*> @test6(i1 %cnd, <2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" {
; CHECK-LABEL: test6
+entry:
+ br i1 %cnd, label %taken, label %untaken
+
+taken: ; preds = %entry
+ %obja = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
+ br label %merge
+
+untaken: ; preds = %entry
+ %objb = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
+ br label %merge
+
+merge: ; preds = %untaken, %taken
; CHECK-LABEL: merge:
; CHECK-NEXT: = phi
; CHECK-NEXT: extractelement
@@ -131,22 +141,9 @@ define <2 x i64 addrspace(1)*> @test6(i1 %cnd, <2 x i64 addrspace(1)*>* %ptr)
; CHECK-NEXT: insertelement
; CHECK-NEXT: insertelement
; CHECK-NEXT: ret <2 x i64 addrspace(1)*>
-entry:
- br i1 %cnd, label %taken, label %untaken
-taken:
- %obja = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
- br label %merge
-untaken:
- %objb = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
- br label %merge
-
-merge:
- %obj = phi <2 x i64 addrspace(1)*> [%obja, %taken], [%objb, %untaken]
- %safepoint_token = call token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 0, i32 0, void ()* @do_safepoint, i32 0, i32 0, i32 0, i32 0)
+ %obj = phi <2 x i64 addrspace(1)*> [ %obja, %taken ], [ %objb, %untaken ]
+ call void @do_safepoint() [ "deopt"() ]
ret <2 x i64 addrspace(1)*> %obj
}
-
declare void @do_safepoint()
-
-declare token @llvm.experimental.gc.statepoint.p0f_isVoidf(i64, i32, void ()*, i32, i32, ...)
OpenPOWER on IntegriCloud