This is an archive of the discontinued LLVM Phabricator instance.

Use LoopRotate PrepareForLTO stage in NPM
ClosedPublic

Authored by sanwou01 on Feb 15 2021, 1:40 AM.

Details

Reviewers
dmgreen
fhahn
Summary

The PrepareForLTO stage of LoopRotate tries to avoid unrolling loops
with calls that might be inlined later. See D94232 where this was
introduced.

We didn't catch all occurances of the LoopRotatePass in the New Pass
Manager, so the original regression in astar returned with the pass
manager switch.

Diff Detail

Event Timeline

sanwou01 created this revision.Feb 15 2021, 1:40 AM
sanwou01 requested review of this revision.Feb 15 2021, 1:40 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2021, 1:40 AM
fhahn added a comment.Feb 16 2021, 8:50 AM

This matches the behavior in the legacy pass manager. LGTM, thanks!

llvm/lib/Passes/PassBuilder.cpp
519

nit: The helper specifically checks for the 'pre-lto' stage, might be good to clarify in the comment, e.g. something like Helper to check if the current compilation phase is preparing for LTO

521

nit: might be slightly simpler to just have return Phase == ThinOrFullLTOPhase::ThinLTOPreLink || Phase == ThinOrFullLTOPhase::ThinLTOPreLink;

fhahn accepted this revision.Feb 16 2021, 1:30 PM

(forgot to press the button) LGTM

This revision is now accepted and ready to land.Feb 16 2021, 1:30 PM
sanwou01 marked 2 inline comments as done.Feb 17 2021, 6:05 AM

I've adopted your suggestions, thanks!

sanwou01 closed this revision.Feb 18 2021, 5:56 AM

Committed as https://reviews.llvm.org/rG93d9a4c95aff . Looks like I forgot to add the "Differential Revision:" line :(