diff options
author | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-01-22 21:02:55 +0000 |
---|---|---|
committer | Sanjoy Das <sanjoy@playingwithpointers.com> | 2016-01-22 21:02:55 +0000 |
commit | 95639746e530d067c501abcc717980e891f8cd25 (patch) | |
tree | edf6050feda3df7cc670d115ec6f91ca67ec4acf /llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | |
parent | 7b384e7fef3dcd1462ae078be60d96252d2ef55f (diff) | |
download | bcm5719-llvm-95639746e530d067c501abcc717980e891f8cd25.tar.gz bcm5719-llvm-95639746e530d067c501abcc717980e891f8cd25.zip |
[PlaceSafepoints] Introduce a -spp-no-statepoints flag
Summary:
This change adds a `-spp-no-statepoints` flag to PlaceSafepoints that
bypasses the code that wraps newly introduced polls and existing calls
in gc.statepoint. With `-spp-no-statepoints` enabled, PlaceSafepoints
effectively becomes a safpeoint **poll** insertion pass.
The eventual goal is to "constant fold" this option, along with
`-rs4gc-use-deopt-bundles` to `true`, once clients using gc.statepoint
are okay doing so.
Reviewers: pgavlin, reames, JosephTremoulet
Subscribers: sanjoy, mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D16439
llvm-svn: 258551
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp index 3df40df861f..63e8115bea6 100644 --- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp +++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp @@ -108,6 +108,11 @@ static cl::opt<int> CountedLoopTripWidth("spp-counted-loop-trip-width", 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)); + // Print tracing output static cl::opt<bool> TraceLSP("spp-trace", cl::Hidden, cl::init(false)); @@ -661,6 +666,15 @@ bool PlaceSafepoints::runOnFunction(Function &F) { ParsePointNeeded.insert(ParsePointNeeded.end(), RuntimeCalls.begin(), RuntimeCalls.end()); } + + // If we've been asked to not wrap the calls with gc.statepoint, then we're + // done. In the near future, this option will be "constant folded" to true, + // and the code below that deals with insert gc.statepoint calls will be + // removed. Wrapping potentially safepointing calls in gc.statepoint will + // then become the responsibility of the RewriteStatepointsForGC pass. + if (NoStatepoints) + return modified; + PollsNeeded.clear(); // make sure we don't accidentally use // The dominator tree has been invalidated by the inlining performed in the // above loop. TODO: Teach the inliner how to update the dom tree? |