[llvm] r229954 - Adjust enablement of RewriteStatepointsForGC
Philip Reames
listmail at philipreames.com
Thu Feb 19 18:34:49 PST 2015
Author: reames
Date: Thu Feb 19 20:34:49 2015
New Revision: 229954
URL: http://llvm.org/viewvc/llvm-project?rev=229954&view=rev
Log:
Adjust enablement of RewriteStatepointsForGC
When back merging the changes in 229945 I noticed that I forgot to mark the test cases with the appropriate GC. We want the rewriting to be off by default (even when manually added to the pass order), not on-by default. To keep the current test working, mark them as using the statepoint-example GC and whitelist that GC.
Longer term, we need a better selection mechanism here for both actual usage and testing. As I migrate more tests to the in tree version of this pass, I will probably need to update the enable/disable logic as well.
Modified:
llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/trunk/test/Transforms/RewriteStatepointsForGC/basics.ll
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=229954&r1=229953&r2=229954&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Thu Feb 19 20:34:49 2015
@@ -1900,7 +1900,8 @@ static bool insertParsePoints(Function &
/// point of this function is as an extension point for custom logic.
static bool shouldRewriteStatepointsIn(Function &F) {
// TODO: This should check the GCStrategy
- return true;
+ const std::string StatepointExampleName("statepoint-example");
+ return StatepointExampleName == F.getGC();
}
bool RewriteStatepointsForGC::runOnFunction(Function &F) {
Modified: llvm/trunk/test/Transforms/RewriteStatepointsForGC/basics.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/RewriteStatepointsForGC/basics.ll?rev=229954&r1=229953&r2=229954&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/RewriteStatepointsForGC/basics.ll (original)
+++ llvm/trunk/test/Transforms/RewriteStatepointsForGC/basics.ll Thu Feb 19 20:34:49 2015
@@ -4,7 +4,7 @@
declare void @foo()
; Trivial relocation over a single call
-define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj) {
+define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-LABEL: @test1
; CHECK-LABEL: entry:
; CHECK-NEXT: gc.statepoint
@@ -15,7 +15,7 @@ entry:
}
; Two safepoints in a row (i.e. consistent liveness)
-define i8 addrspace(1)* @test2(i8 addrspace(1)* %obj) {
+define i8 addrspace(1)* @test2(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-LABEL: @test2
; CHECK-LABEL: entry:
; CHECK-NEXT: gc.statepoint
@@ -29,7 +29,7 @@ entry:
}
; A simple derived pointer
-define i8 @test3(i8 addrspace(1)* %obj) {
+define i8 @test3(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-LABEL: entry:
; CHECK-NEXT: getelementptr
; CHECK-NEXT: gc.statepoint
@@ -49,7 +49,7 @@ entry:
; Tests to make sure we visit both the taken and untaken predeccessor
; of merge. This was a bug in the dataflow liveness at one point.
-define i8 addrspace(1)* @test4(i1 %cmp, i8 addrspace(1)* %obj) {
+define i8 addrspace(1)* @test4(i1 %cmp, i8 addrspace(1)* %obj) gc "statepoint-example" {
entry:
br i1 %cmp, label %taken, label %untaken
More information about the llvm-commits
mailing list