This is an archive of the discontinued LLVM Phabricator instance.

[PlaceSafepoints] Remove dependence on LoopSimplify
ClosedPublic

Authored by reames on May 7 2015, 4:23 PM.

Details

Summary

As a step towards getting rid of internal pass manager hack entirely, remove the need for loop simplify to run in the inner pass manager. The new code does produce slightly different loop structures, so this isn't technically NFC.

Diff Detail

Repository
rL LLVM

Event Timeline

reames updated this revision to Diff 25259.May 7 2015, 4:23 PM
reames retitled this revision from to [PlaceSimplify] Remove dependence on LoopSimplify.
reames updated this object.
reames edited the test plan for this revision. (Show Details)
reames added a reviewer: sanjoy.
reames added a subscriber: Unknown Object (MLST).
reames retitled this revision from [PlaceSimplify] Remove dependence on LoopSimplify to [PlaceSafepoints] Remove dependence on LoopSimplify.May 7 2015, 4:27 PM
sanjoy accepted this revision.May 8 2015, 1:13 AM
sanjoy edited edge metadata.
sanjoy added inline comments.
lib/Transforms/Scalar/PlaceSafepoints.cpp
571 ↗(On Diff #25259)

std::unique only removes consecutive elements so I don't think it would work with an unsorted array. I think it is sufficient to just move this after the std::sort on PollLocations below.

575 ↗(On Diff #25259)

LLVM naming conventions say:

auto OrderByBBName = [](Instruction *A, Instruction *A) {
576 ↗(On Diff #25259)

StringRef has an operator<.

604 ↗(On Diff #25259)

Side comment, unrelated to this change: this nested loop uses i, the same induction variable as the outer loop which can be confusing. It might be clearer to change both these loops to be range for loops.

616 ↗(On Diff #25259)

Side comment that has nothing to do with this change: SplitEdge optionally takes a DominatorTree as input -- if the reason for doing that is that SplitEdge updates the dom tree, then we can just pass in the DT to SplitEdge not recalculate it below.

This revision is now accepted and ready to land.May 8 2015, 1:13 AM
This revision was automatically updated to reflect the committed changes.