This is an archive of the discontinued LLVM Phabricator instance.

[PlaceSafepoints] Reduce dominator tree recalculation
ClosedPublic

Authored by reames on May 12 2015, 5:05 PM.

Details

Summary

Reduce recalculation of the dominator tree by identifying all sites that will need a safepoint poll before doing any of the insertion. This allows us to invalidate the dominator info once, rather than once per safepoint poll inserted.

While I'm at it, update findLocationForEntrySafepoint to properly update the dom tree now that the interface has been made easy. When first written, it wasn't per comment in the code.

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 25649.May 12 2015, 5:05 PM
reames retitled this revision from to [PlaceSafepoints] Reduce dominator tree recalculation.
reames updated this object.
reames edited the test plan for this revision. (Show Details)
reames added reviewers: sanjoy, igor-laevsky.
reames added a subscriber: Unknown Object (MLST).
sanjoy accepted this revision.May 12 2015, 5:21 PM
sanjoy edited edge metadata.

LGTM with comments.

lib/Transforms/Scalar/PlaceSafepoints.cpp
661 ↗(On Diff #25649)

I think a SmallVector is more appropriate here.

666 ↗(On Diff #25649)

I don't think this is the right way to avoid using PollsNeeded. As a later change, we should factor PlaceSafepoints::runOnFunction into smaller functions such that PollsNeeded is statically not in scope of the functions that should not be using it.

This revision is now accepted and ready to land.May 12 2015, 5:21 PM
reames added inline comments.May 12 2015, 5:35 PM
lib/Transforms/Scalar/PlaceSafepoints.cpp
661 ↗(On Diff #25649)

We can't currently create a small vector of CallSites. I haven't dug into why not, but it fails to compile.

666 ↗(On Diff #25649)

Agreed. I'll submit as is, but plan to refactor in this direction.

This revision was automatically updated to reflect the committed changes.