[llvm] r259096 - [PlaceSafepoints] Clamp NoStatepoints to true
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 28 13:51:14 PST 2016
Author: sanjoy
Date: Thu Jan 28 15:51:14 2016
New Revision: 259096
URL: http://llvm.org/viewvc/llvm-project?rev=259096&view=rev
Log:
[PlaceSafepoints] Clamp NoStatepoints to true
This change permanently clamps -spp-no-statepoints to true (the code
deletion will come later). Tests that specifically tested
PlaceSafepoint's ability to wrap calls in gc.statepoint have been moved
to RS4GC's test suite.
Added:
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/call-gc-result.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/invokes.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/leaf-function.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-calling-conventions.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-coreclr.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll
llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-format.ll
- copied, changed from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll
Removed:
llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll
llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll
llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll
llvm/trunk/test/Transforms/PlaceSafepoints/patchable-statepoints.ll
llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll
llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll
Modified:
llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp
llvm/trunk/test/Transforms/PlaceSafepoints/basic.ll
llvm/trunk/test/Transforms/PlaceSafepoints/call-in-loop.ll
llvm/trunk/test/Transforms/PlaceSafepoints/finite-loops.ll
llvm/trunk/test/Transforms/PlaceSafepoints/no-statepoints.ll
llvm/trunk/test/Transforms/PlaceSafepoints/split-backedge.ll
llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll
llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-frameescape.ll
Modified: llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/PlaceSafepoints.cpp Thu Jan 28 15:51:14 2016
@@ -108,10 +108,7 @@ static cl::opt<int> CountedLoopTripWidth
static cl::opt<bool> SplitBackedge("spp-split-backedge", cl::Hidden,
cl::init(false));
-// If true, don't wrap calls (the ones present in the IR, and the ones
-// introduced due to polls) in gc.statepoint.
-static cl::opt<bool> NoStatepoints("spp-no-statepoints", cl::Hidden,
- cl::init(false));
+static const bool NoStatepoints = true;
// Print tracing output
static cl::opt<bool> TraceLSP("spp-trace", cl::Hidden, cl::init(false));
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/basic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/basic.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/basic.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/basic.ll Thu Jan 28 15:51:14 2016
@@ -6,7 +6,7 @@ define void @test_entry() gc "statepoint
; CHECK-LABEL: @test_entry
entry:
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
ret void
}
@@ -14,7 +14,7 @@ entry:
define void @test_negative() {
; CHECK-LABEL: @test_negative
entry:
-; CHECK-NOT: statepoint
+; CHECK-NOT: do_safepoint
ret void
}
@@ -25,13 +25,12 @@ define void @test_backedge() gc "statepo
entry:
; CHECK-LABEL: entry
; This statepoint is technically not required, but we don't exploit that yet.
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
br label %other
; CHECK-LABEL: other
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
other:
- call void undef()
br label %other
}
@@ -41,40 +40,24 @@ define void @test_unreachable() gc "stat
; CHECK-LABEL: test_unreachable
entry:
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
ret void
; CHECK-NOT: other
-; CHECK-NOT: statepoint
+; CHECK-NOT: do_safepoint
other:
br label %other
}
declare void @foo()
-; Do we turn a call into it's own statepoint
-define void @test_simple_call() gc "statepoint-example" {
-; CHECK-LABEL: test_simple_call
-entry:
- br label %other
-other:
-; CHECK-LABEL: other
-; CHECK: statepoint
-; CHECK-NOT: gc.result
- call void @foo()
- ret void
-}
-
declare zeroext i1 @i1_return_i1(i1)
define i1 @test_call_with_result() gc "statepoint-example" {
; CHECK-LABEL: test_call_with_result
-; This is checking that a statepoint_poll + statepoint + result is
-; inserted for a function that takes 1 argument.
-; CHECK: gc.statepoint.p0f_isVoidf
-; CHECK: gc.statepoint.p0f_i1i1f
-; CHECK: (i64 2882400000, i32 0, i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0, i32 0)
-; CHECK: %call12 = call i1 @llvm.experimental.gc.result.i1
+; This is checking that a statepoint_poll is inserted for a function
+; that takes 1 argument.
+; CHECK: call void @do_safepoint
entry:
%call1 = tail call i1 (i1) @i1_return_i1(i1 false)
ret i1 %call1
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/call-in-loop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/call-in-loop.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/call-in-loop.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/call-in-loop.ll Thu Jan 28 15:51:14 2016
@@ -10,13 +10,12 @@ define void @test1() gc "statepoint-exam
entry:
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
br label %loop
loop:
; CHECK-LABEL: loop
-; CHECK: @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 0, void ()* @foo
-; CHECK-NOT: statepoint
+; CHECK-NOT: call void @do_safepoint
call void @foo()
br label %loop
}
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll (removed)
@@ -1,38 +0,0 @@
-;; RUN: opt < %s -place-safepoints -S | FileCheck %s
-
-;; This test is to verify that gc_result from a call statepoint
-;; can have preceding phis in its parent basic block. Unlike
-;; invoke statepoint, call statepoint does not terminate the
-;; block, and thus its gc_result is in the same block with the
-;; call statepoint.
-
-declare i32 @foo()
-
-define i32 @test1(i1 %cond, i32 %a) gc "statepoint-example" {
-entry:
- br i1 %cond, label %branch1, label %branch2
-
-branch1:
- %b = add i32 %a, 1
- br label %merge
-
-branch2:
- br label %merge
-
-merge:
-;; CHECK: %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
-;; CHECK-NEXT: %safepoint_token1 = call token (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 2882400000, i32 0, i32 ()* @foo, i32 0, i32 0, i32 0, i32 0)
-;; CHECK-NEXT: %ret2 = call i32 @llvm.experimental.gc.result.i32(token %safepoint_token1)
- %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
- %ret = call i32 @foo()
- ret i32 %ret
-}
-
-; This function is inlined when inserting a poll.
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-; CHECK-LABEL: gc.safepoint_poll
-entry:
- call void @do_safepoint()
- ret void
-}
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/finite-loops.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/finite-loops.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/finite-loops.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/finite-loops.ll Thu Jan 28 15:51:14 2016
@@ -8,9 +8,9 @@
define void @test1(i32) gc "statepoint-example" {
; CHECK-LABEL: test1
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: loop
-; CHECK-NOT: statepoint
+; CHECK-NOT: call void @do_safepoint
; CHECK-LABEL: exit
entry:
@@ -30,9 +30,9 @@ exit:
define void @test2(i32) gc "statepoint-example" {
; CHECK-LABEL: test2
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: loop
-; CHECK-NOT: statepoint
+; CHECK-NOT: call void @do_safepoint
; CHECK-LABEL: exit
entry:
@@ -55,9 +55,9 @@ exit:
define void @test3(i8 %upper) gc "statepoint-example" {
; CHECK-LABEL: test3
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: loop
-; CHECK-NOT: statepoint
+; CHECK-NOT: call void @do_safepoint
; CHECK-LABEL: exit
entry:
@@ -77,16 +77,16 @@ exit:
define void @test4(i64 %upper) gc "statepoint-example" {
; CHECK-LABEL: test4
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: loop
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: exit
; COUNTED-64-LABEL: test4
; COUNTED-64-LABEL: entry
-; COUNTED-64: statepoint
+; COUNTED-64: call void @do_safepoint
; COUNTED-64-LABEL: loop
-; COUNTED-64-NOT: statepoint
+; COUNTED-64-NOT: call void @do_safepoint
; COUNTED-64-LABEL: exit
entry:
@@ -107,16 +107,16 @@ exit:
define void @test5(i64 %upper) gc "statepoint-example" {
; CHECK-LABEL: test5
; CHECK-LABEL: entry
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: loop
-; CHECK: statepoint
+; CHECK: call void @do_safepoint
; CHECK-LABEL: exit
; COUNTED-64-LABEL: test5
; COUNTED-64-LABEL: entry
-; COUNTED-64: statepoint
+; COUNTED-64: call void @do_safepoint
; COUNTED-64-LABEL: loop
-; COUNTED-64: statepoint
+; COUNTED-64: call void @do_safepoint
; COUNTED-64-LABEL: exit
entry:
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll (removed)
@@ -1,111 +0,0 @@
-; RUN: opt < %s -S -place-safepoints | FileCheck %s
-
-declare i64 addrspace(1)* @some_call(i64 addrspace(1)*)
-declare i32 @personality_function()
-
-define i64 addrspace(1)* @test_basic(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality_function {
-; CHECK-LABEL: entry:
-entry:
- ; CHECK: invoke
- ; CHECK: statepoint
- ; CHECK: some_call
- %ret_val = invoke i64 addrspace(1)* @some_call(i64 addrspace(1)* %obj)
- to label %normal_return unwind label %exceptional_return
-
-; CHECK-LABEL: normal_return:
-; CHECK: gc.result
-; CHECK: ret i64
-
-normal_return:
- ret i64 addrspace(1)* %ret_val
-
-; CHECK-LABEL: exceptional_return:
-; CHECK: landingpad
-; CHECK: ret i64
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
- cleanup
- ret i64 addrspace(1)* %obj1
-}
-
-define i64 addrspace(1)* @test_two_invokes(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality_function {
-; CHECK-LABEL: entry:
-entry:
- ; CHECK: invoke
- ; CHECK: statepoint
- ; CHECK: some_call
- %ret_val1 = invoke i64 addrspace(1)* @some_call(i64 addrspace(1)* %obj)
- to label %second_invoke unwind label %exceptional_return
-
-; CHECK-LABEL: second_invoke:
-second_invoke:
- ; CHECK: invoke
- ; CHECK: statepoint
- ; CHECK: some_call
- %ret_val2 = invoke i64 addrspace(1)* @some_call(i64 addrspace(1)* %ret_val1)
- to label %normal_return unwind label %exceptional_return
-
-; CHECK-LABEL: normal_return:
-normal_return:
- ; CHECK: gc.result
- ; CHECK: ret i64
- ret i64 addrspace(1)* %ret_val2
-
-; CHECK: exceptional_return:
-; CHECK: ret i64
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
- cleanup
- ret i64 addrspace(1)* %obj1
-}
-
-define i64 addrspace(1)* @test_phi_node(i1 %cond, i64 addrspace(1)* %obj) gc "statepoint-example" personality i32 ()* @personality_function {
-; CHECK-LABEL: @test_phi_node
-; CHECK-LABEL: entry:
-entry:
- br i1 %cond, label %left, label %right
-
-left:
- %ret_val_left = invoke i64 addrspace(1)* @some_call(i64 addrspace(1)* %obj)
- to label %merge unwind label %exceptional_return
-
-right:
- %ret_val_right = invoke i64 addrspace(1)* @some_call(i64 addrspace(1)* %obj)
- to label %merge unwind label %exceptional_return
-
-; CHECK: merge[[A:[0-9]]]:
-; CHECK: gc.result
-; CHECK: br label %[[with_phi:merge[0-9]*]]
-
-; CHECK: merge[[B:[0-9]]]:
-; CHECK: gc.result
-; CHECK: br label %[[with_phi]]
-
-; CHECK: [[with_phi]]:
-; CHECK: phi
-; CHECK: ret i64 addrspace(1)* %ret_val
-merge:
- %ret_val = phi i64 addrspace(1)* [%ret_val_left, %left], [%ret_val_right, %right]
- ret i64 addrspace(1)* %ret_val
-
-; CHECK-LABEL: exceptional_return:
-; CHECK: ret i64 addrspace(1)*
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
- cleanup
- ret i64 addrspace(1)* %obj
-}
-
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-; CHECK-LABEL: gc.safepoint_poll
-; CHECK-LABEL: entry
-; CHECK-NEXT: do_safepoint
-; CHECK-NEXT: ret void
-entry:
- call void @do_safepoint()
- ret void
-}
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll (removed)
@@ -1,35 +0,0 @@
-; RUN: opt < %s -S -place-safepoints | FileCheck %s
-
-declare void @foo() "gc-leaf-function"
-declare void @bar()
-
-; Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
-; into a safepoint. An entry safepoint should get inserted, though.
-define void @test_leaf_function() gc "statepoint-example" {
-; CHECK-LABEL: test_leaf_function
-; CHECK: gc.statepoint.p0f_isVoidf
-; CHECK-NOT: statepoint
-; CHECK-NOT: gc.result
-entry:
- call void @foo()
- ret void
-}
-
-define void @test_leaf_function_call() gc "statepoint-example" {
-; CHECK-LABEL: test_leaf_function_call
-; CHECK: gc.statepoint.p0f_isVoidf
-; CHECK-NOT: statepoint
-; CHECK-NOT: gc.result
-entry:
- call void @bar() "gc-leaf-function"
- ret void
-}
-
-; This function is inlined when inserting a poll.
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-; CHECK-LABEL: gc.safepoint_poll
-entry:
- call void @do_safepoint()
- ret void
-}
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/no-statepoints.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/no-statepoints.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/no-statepoints.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/no-statepoints.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt -spp-no-statepoints -S -place-safepoints < %s | FileCheck %s
+; RUN: opt -S -place-safepoints < %s | FileCheck %s
define void @test() gc "statepoint-example" {
; CHECK-LABEL: test(
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/patchable-statepoints.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/patchable-statepoints.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/patchable-statepoints.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/patchable-statepoints.ll (removed)
@@ -1,44 +0,0 @@
-; RUN: opt -place-safepoints -S < %s | FileCheck %s
-
-declare void @f()
-declare i32 @personality_function()
-
-define void @test_id() gc "statepoint-example" personality i32 ()* @personality_function {
-; CHECK-LABEL: @test_id(
-entry:
-; CHECK-LABEL: entry:
-; CHECK: invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 100, i32 0, void ()* @f
- invoke void @f() "statepoint-id"="100" to label %normal_return unwind label %exceptional_return
-
-normal_return:
- ret void
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} cleanup
- ret void
-}
-
-define void @test_num_patch_bytes() gc "statepoint-example" personality i32 ()* @personality_function {
-; CHECK-LABEL: @test_num_patch_bytes(
-entry:
-; CHECK-LABEL: entry:
-; CHECK: invoke token (i64, i32, void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(i64 2882400000, i32 99, void ()* @f,
- invoke void @f() "statepoint-num-patch-bytes"="99" to label %normal_return unwind label %exceptional_return
-
-normal_return:
- ret void
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32} cleanup
- ret void
-}
-
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-entry:
- call void @do_safepoint()
- ret void
-}
-
-; CHECK-NOT: statepoint-id
-; CHECK-NOT: statepoint-num-patch_bytes
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/split-backedge.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/split-backedge.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/split-backedge.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/split-backedge.ll Thu Jan 28 15:51:14 2016
@@ -4,7 +4,7 @@
define void @test(i32, i1 %cond) gc "statepoint-example" {
; CHECK-LABEL: @test
; CHECK-LABEL: loop.loop_crit_edge
-; CHECK: gc.statepoint
+; CHECK: call void @do_safepoint
; CHECK-NEXT: br label %loop
entry:
br label %loop
@@ -23,10 +23,10 @@ exit:
define void @test2(i32, i1 %cond) gc "statepoint-example" {
; CHECK-LABEL: @test2
; CHECK-LABEL: loop2.loop2_crit_edge:
-; CHECK: gc.statepoint
+; CHECK: call void @do_safepoint
; CHECK-NEXT: br label %loop2
; CHECK-LABEL: loop2.loop_crit_edge:
-; CHECK: gc.statepoint
+; CHECK: call void @do_safepoint
; CHECK-NEXT: br label %loop
entry:
br label %loop
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll (removed)
@@ -1,42 +0,0 @@
-; RUN: opt -place-safepoints -S < %s | FileCheck %s
-
-; Ensure that the gc.statepoint calls / invokes we generate carry over
-; the right calling conventions.
-
-define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
-; CHECK-LABEL: @test_invoke_format(
-; CHECK-LABEL: entry:
-; CHECK: invoke coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
-entry:
- %ret_val = invoke coldcc i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
- to label %normal_return unwind label %exceptional_return
-
-normal_return:
- ret i64 addrspace(1)* %ret_val
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
- cleanup
- ret i64 addrspace(1)* %obj1
-}
-
-define i64 addrspace(1)* @test_call_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
-; CHECK-LABEL: @test_call_format(
-; CHECK-LABEL: entry:
-; CHECK: call coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
-entry:
- %ret_val = call coldcc i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
- ret i64 addrspace(1)* %ret_val
-}
-
-; This function is inlined when inserting a poll.
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-; CHECK-LABEL: gc.safepoint_poll
-entry:
- call void @do_safepoint()
- ret void
-}
-
-declare coldcc i64 addrspace(1)* @callee(i64 addrspace(1)*)
-declare i32 @personality()
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll Thu Jan 28 15:51:14 2016
@@ -8,11 +8,9 @@ declare void @foo()
define void @test_simple_call() gc "coreclr" {
; CHECK-LABEL: test_simple_call
entry:
+; CHECK: call void @do_safepoint
br label %other
other:
-; CHECK-LABEL: other
-; CHECK: statepoint
-; CHECK-NOT: gc.result
call void @foo()
ret void
}
Removed: llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll?rev=259095&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll (removed)
@@ -1,42 +0,0 @@
-; RUN: opt -place-safepoints -S < %s | FileCheck %s
-
-; Ensure that the gc.statepoint calls / invokes we generate have the
-; set of arguments we expect it to have.
-
-define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
-; CHECK-LABEL: @test_invoke_format(
-; CHECK-LABEL: entry:
-; CHECK: invoke token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
-entry:
- %ret_val = invoke i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
- to label %normal_return unwind label %exceptional_return
-
-normal_return:
- ret i64 addrspace(1)* %ret_val
-
-exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
- cleanup
- ret i64 addrspace(1)* %obj1
-}
-
-define i64 addrspace(1)* @test_call_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
-; CHECK-LABEL: @test_call_format(
-; CHECK-LABEL: entry:
-; CHECK: call token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
-entry:
- %ret_val = call i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
- ret i64 addrspace(1)* %ret_val
-}
-
-; This function is inlined when inserting a poll.
-declare void @do_safepoint()
-define void @gc.safepoint_poll() {
-; CHECK-LABEL: gc.safepoint_poll
-entry:
- call void @do_safepoint()
- ret void
-}
-
-declare i64 addrspace(1)* @callee(i64 addrspace(1)*)
-declare i32 @personality()
Modified: llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-frameescape.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-frameescape.ll?rev=259096&r1=259095&r2=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-frameescape.ll (original)
+++ llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-frameescape.ll Thu Jan 28 15:51:14 2016
@@ -9,7 +9,7 @@ entry:
; CHECK-LABEL: entry
; CHECK-NEXT: alloca
; CHECK-NEXT: localescape
-; CHECK-NEXT: statepoint
+; CHECK-NEXT: call void @do_safepoint
%ptr = alloca i32
call void (...) @llvm.localescape(i32* %ptr)
ret void
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/call-gc-result.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/call-gc-result.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/call-gc-result.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/call_gc_result.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/call-gc-result.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-;; RUN: opt < %s -place-safepoints -S | FileCheck %s
+;; RUN: opt < %s -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles -S | FileCheck %s
;; This test is to verify that gc_result from a call statepoint
;; can have preceding phis in its parent basic block. Unlike
@@ -21,8 +21,8 @@ branch2:
merge:
;; CHECK: %phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
-;; CHECK-NEXT: %safepoint_token1 = call token (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 2882400000, i32 0, i32 ()* @foo, i32 0, i32 0, i32 0, i32 0)
-;; CHECK-NEXT: %ret2 = call i32 @llvm.experimental.gc.result.i32(token %safepoint_token1)
+;; CHECK-NEXT: [[TOKEN:%[^ ]+]] = call token (i64, i32, i32 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32f(i64 2882400000, i32 0, i32 ()* @foo, i32 0, i32 0, i32 0, i32 0
+;; CHECK-NEXT: call i32 @llvm.experimental.gc.result.i32(token [[TOKEN]])
%phi = phi i32 [ %a, %branch2 ], [ %b, %branch1 ]
%ret = call i32 @foo()
ret i32 %ret
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/invokes.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/invokes.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/invokes.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/invokes.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/invokes.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt < %s -S -place-safepoints | FileCheck %s
+; RUN: opt < %s -S -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles | FileCheck %s
declare i64 addrspace(1)* @some_call(i64 addrspace(1)*)
declare i32 @personality_function()
@@ -24,7 +24,7 @@ normal_return:
; CHECK: ret i64
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
+ %landing_pad4 = landingpad token
cleanup
ret i64 addrspace(1)* %obj1
}
@@ -56,7 +56,7 @@ normal_return:
; CHECK: ret i64
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
+ %landing_pad4 = landingpad token
cleanup
ret i64 addrspace(1)* %obj1
}
@@ -94,7 +94,7 @@ merge:
; CHECK: ret i64 addrspace(1)*
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
+ %landing_pad4 = landingpad token
cleanup
ret i64 addrspace(1)* %obj
}
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/leaf-function.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/leaf-function.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/leaf-function.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/leaf-function.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/leaf-function.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt < %s -S -place-safepoints | FileCheck %s
+; RUN: opt < %s -S -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles | FileCheck %s
declare void @foo() "gc-leaf-function"
declare void @bar()
@@ -7,8 +7,7 @@ declare void @bar()
; into a safepoint. An entry safepoint should get inserted, though.
define void @test_leaf_function() gc "statepoint-example" {
; CHECK-LABEL: test_leaf_function
-; CHECK: gc.statepoint.p0f_isVoidf
-; CHECK-NOT: statepoint
+; CHECK-NOT: gc.statepoint
; CHECK-NOT: gc.result
entry:
call void @foo()
@@ -17,8 +16,7 @@ entry:
define void @test_leaf_function_call() gc "statepoint-example" {
; CHECK-LABEL: test_leaf_function_call
-; CHECK: gc.statepoint.p0f_isVoidf
-; CHECK-NOT: statepoint
+; CHECK-NOT: gc.statepoint
; CHECK-NOT: gc.result
entry:
call void @bar() "gc-leaf-function"
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-calling-conventions.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-calling-conventions.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-calling-conventions.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-calling-conventions.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-calling-conventions.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt -place-safepoints -S < %s | FileCheck %s
+; RUN: opt -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles -S < %s | FileCheck %s
; Ensure that the gc.statepoint calls / invokes we generate carry over
; the right calling conventions.
@@ -6,7 +6,7 @@
define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
; CHECK-LABEL: @test_invoke_format(
; CHECK-LABEL: entry:
-; CHECK: invoke coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
+; CHECK: invoke coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0
entry:
%ret_val = invoke coldcc i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
to label %normal_return unwind label %exceptional_return
@@ -15,7 +15,7 @@ normal_return:
ret i64 addrspace(1)* %ret_val
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
+ %landing_pad4 = landingpad token
cleanup
ret i64 addrspace(1)* %obj1
}
@@ -23,7 +23,7 @@ exceptional_return:
define i64 addrspace(1)* @test_call_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
; CHECK-LABEL: @test_call_format(
; CHECK-LABEL: entry:
-; CHECK: call coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
+; CHECK: call coldcc token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0
entry:
%ret_val = call coldcc i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
ret i64 addrspace(1)* %ret_val
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-coreclr.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-coreclr.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-coreclr.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-coreclr.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-coreclr.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt < %s -S -place-safepoints | FileCheck %s
+; RUN: opt < %s -S -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles | FileCheck %s
; Basic test to make sure that safepoints are placed
; for CoreCLR GC
Copied: llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-format.ll (from r259094, llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-format.ll?p2=llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-format.ll&p1=llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll&r1=259094&r2=259096&rev=259096&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/PlaceSafepoints/statepoint-format.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/deopt-bundles/statepoint-format.ll Thu Jan 28 15:51:14 2016
@@ -1,4 +1,4 @@
-; RUN: opt -place-safepoints -S < %s | FileCheck %s
+; RUN: opt -rewrite-statepoints-for-gc -rs4gc-use-deopt-bundles -S < %s | FileCheck %s
; Ensure that the gc.statepoint calls / invokes we generate have the
; set of arguments we expect it to have.
@@ -6,7 +6,7 @@
define i64 addrspace(1)* @test_invoke_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" personality i32 ()* @personality {
; CHECK-LABEL: @test_invoke_format(
; CHECK-LABEL: entry:
-; CHECK: invoke token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
+; CHECK: invoke token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0, i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1)
entry:
%ret_val = invoke i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
to label %normal_return unwind label %exceptional_return
@@ -15,7 +15,7 @@ normal_return:
ret i64 addrspace(1)* %ret_val
exceptional_return:
- %landing_pad4 = landingpad {i8*, i32}
+ %landing_pad4 = landingpad token
cleanup
ret i64 addrspace(1)* %obj1
}
@@ -23,7 +23,7 @@ exceptional_return:
define i64 addrspace(1)* @test_call_format(i64 addrspace(1)* %obj, i64 addrspace(1)* %obj1) gc "statepoint-example" {
; CHECK-LABEL: @test_call_format(
; CHECK-LABEL: entry:
-; CHECK: call token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0)
+; CHECK: call token (i64, i32, i64 addrspace(1)* (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64p1i64f(i64 2882400000, i32 0, i64 addrspace(1)* (i64 addrspace(1)*)* @callee, i32 1, i32 0, i64 addrspace(1)* %obj, i32 0, i32 0, i64 addrspace(1)* %obj)
entry:
%ret_val = call i64 addrspace(1)* @callee(i64 addrspace(1)* %obj)
ret i64 addrspace(1)* %ret_val
More information about the llvm-commits
mailing list