summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2015-05-12 23:39:23 +0000
committerPhilip Reames <listmail@philipreames.com>2015-05-12 23:39:23 +0000
commit89fe570958f8b82df9a9c3b4c251ecba9753272a (patch)
tree8b315d89257a9d471088e1d3b4390ea526c7563c
parentee13fbe848024543a34625f3229ca16c24cbcc5b (diff)
downloadbcm5719-llvm-89fe570958f8b82df9a9c3b4c251ecba9753272a.tar.gz
bcm5719-llvm-89fe570958f8b82df9a9c3b4c251ecba9753272a.zip
[PlaceSafepoints] Followup to commit L237172
Responding to review feedback from http://reviews.llvm.org/D9585 1) Remove a variable shadow by converting the outer loop to a range for loop. We never really used the 'i' variable which was being shadowed. 2) Reduce DominatorTree recalculations by passing the DT to SplitEdge. llvm-svn: 237212
-rw-r--r--llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
index b5124b7adc4..ff3d67a6548 100644
--- a/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
+++ b/llvm/lib/Transforms/Scalar/PlaceSafepoints.cpp
@@ -606,13 +606,11 @@ bool PlaceSafepoints::runOnFunction(Function &F) {
PollLocations.end());
// Insert a poll at each point the analysis pass identified
- for (size_t i = 0; i < PollLocations.size(); i++) {
+ // The poll location must be the terminator of a loop latch block.
+ for (TerminatorInst *Term : PollLocations) {
// We are inserting a poll, the function is modified
modified = true;
-
- // The poll location must be the terminator of a loop latch block.
- TerminatorInst *Term = PollLocations[i];
-
+
std::vector<CallSite> ParsePoints;
if (SplitBackedge) {
// Split the backedge of the loop and insert the poll within that new
@@ -639,11 +637,8 @@ bool PlaceSafepoints::runOnFunction(Function &F) {
// date and use a more natural merged loop.
SetVector<BasicBlock *> SplitBackedges;
for (BasicBlock *Header : Headers) {
- BasicBlock *NewBB = SplitEdge(Term->getParent(), Header, nullptr);
- SplitBackedges.insert(NewBB);
- }
- DT.recalculate(F);
- for (BasicBlock *NewBB : SplitBackedges) {
+ BasicBlock *NewBB = SplitEdge(Term->getParent(), Header, &DT);
+
std::vector<CallSite> RuntimeCalls;
InsertSafepointPoll(DT, NewBB->getTerminator(), RuntimeCalls);
NumBackedgeSafepoints++;
OpenPOWER on IntegriCloud