This is an archive of the discontinued LLVM Phabricator instance.

[LegacyPM] Make the 'addLoop' method accept a loop to add rather than having it internally allocate the loop.
ClosedPublic

Authored by chandlerc on May 24 2017, 5:39 PM.

Details

Summary

This is a much more flexible API and necessary in the new loop unswitch
to reasonably support both new and old PMs in common code. It also just
seems like a cleaner separation of concerns.

NFC, this should just be a pure refactoring.

Diff Detail

Repository
rL LLVM

Event Timeline

chandlerc created this revision.May 24 2017, 5:39 PM
davide accepted this revision.May 24 2017, 5:46 PM
davide added a subscriber: davide.

This is fine assuming you audited all the callers (a quick grep shows just these two).

lib/Analysis/LoopPass.cpp
76 ↗(On Diff #100189)

this should be insert, I think, but it's not your fault.

This revision is now accepted and ready to land.May 24 2017, 5:46 PM
chandlerc marked an inline comment as done.May 24 2017, 7:56 PM

Thanks, landing!

This is fine assuming you audited all the callers (a quick grep shows just these two).

Yeah, my grep concludes the same.

lib/Analysis/LoopPass.cpp
76 ↗(On Diff #100189)

I'll fix the typo while here.

This revision was automatically updated to reflect the committed changes.
chandlerc marked an inline comment as done.