summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2015-12-15 19:40:57 +0000
committerJustin Bogner <mail@justinbogner.com>2015-12-15 19:40:57 +0000
commit843fb204b7102bc1abd7fdadf39f3ac2e0acb479 (patch)
tree911cfa2d243582a779de1e1edffbc4a01045d384 /llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
parent33beb24318f9e5355f1aa481cddcbb50eaf2a156 (diff)
downloadbcm5719-llvm-843fb204b7102bc1abd7fdadf39f3ac2e0acb479.tar.gz
bcm5719-llvm-843fb204b7102bc1abd7fdadf39f3ac2e0acb479.zip
LPM: Stop threading `Pass *` through all of the loop utility APIs. NFC
A large number of loop utility functions take a `Pass *` and reach into it to find out which analyses to preserve. There are a number of problems with this: - The APIs have access to pretty well any Pass state they want, so it's hard to tell what they may or may not do. - Other APIs have copied these and pass around a `Pass *` even though they don't even use it. Some of these just hand a nullptr to the API since the callers don't even have a pass available. - Passes in the new pass manager don't work like the current ones, so the APIs can't be used as is there. Instead, we should explicitly thread the analysis results that we actually care about through these APIs. This is both simpler and more reusable. llvm-svn: 255669
Diffstat (limited to 'llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index 169a09ece02..7fe286f70c4 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -206,7 +206,7 @@ static bool needsStatepoint(const CallSite &CS) {
return true;
}
-static Value *ReplaceWithStatepoint(const CallSite &CS, Pass *P);
+static Value *ReplaceWithStatepoint(const CallSite &CS);
/// Returns true if this loop is known to contain a call safepoint which
/// must unconditionally execute on any iteration of the loop which returns
@@ -704,7 +704,7 @@ bool PlaceSafepoints::runOnFunction(Function &F) {
Invoke->getParent());
}
- Value *GCResult = ReplaceWithStatepoint(CS, nullptr);
+ Value *GCResult = ReplaceWithStatepoint(CS);
Results.push_back(GCResult);
}
assert(Results.size() == ParsePointNeeded.size());
@@ -830,8 +830,7 @@ InsertSafepointPoll(Instruction *InsertBefore,
/// Replaces the given call site (Call or Invoke) with a gc.statepoint
/// intrinsic with an empty deoptimization arguments list. This does
/// NOT do explicit relocation for GC support.
-static Value *ReplaceWithStatepoint(const CallSite &CS, /* to replace */
- Pass *P) {
+static Value *ReplaceWithStatepoint(const CallSite &CS /* to replace */) {
assert(CS.getInstruction()->getModule() && "must be set");
// TODO: technically, a pass is not allowed to get functions from within a
OpenPOWER on IntegriCloud