This is an archive of the discontinued LLVM Phabricator instance.

[MachineOuliner][NFC] Refactoring code to make outline rerunning a cleaner diff.
ClosedPublic

Authored by plotfi on Oct 27 2019, 12:15 PM.

Details

Summary

I want to add the ability to rerun the outliner in certain cases, and I thought this could be an NFC change that could make a subsequent change a cleaner diff.

Diff Detail

Event Timeline

plotfi created this revision.Oct 27 2019, 12:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 27 2019, 12:15 PM

I think the implementation of doOutline is missing here?

llvm/lib/CodeGen/MachineOutliner.cpp
899

I think that if you write this as doOutline(), Doxygen will automatically create a link to its entry on doOutline. That might be useful to people looking at the docs.

(Judging by http://www.doxygen.nl/manual/autolink.html)

plotfi marked an inline comment as done.Oct 28 2019, 10:24 AM
plotfi added inline comments.
llvm/lib/CodeGen/MachineOutliner.cpp
1440

@paquette The implementation of MachineOutliner::doOutline is right here.

plotfi updated this revision to Diff 226703.Oct 28 2019, 10:26 AM
plotfi marked an inline comment as done.

adding 'doOutline()' for doxygen comments.

This revision is now accepted and ready to land.Oct 28 2019, 10:35 AM

Maybe I just don't see it but I don't get the reason for creating this new function doOutline. Doesn't it basically just call outline? Why can't you just add OutlinedFunctionNum to outline and then call outline in runOnModule?

Please be so kind to clarify this.

Maybe I just don't see it but I don't get the reason for creating this new function doOutline. Doesn't it basically just call outline? Why can't you just add OutlinedFunctionNum to outline and then call outline in runOnModule?

Please be so kind to clarify this.

It’s possible to get greater size reduction through rerunning the outliner repeatedly. I and a couple other folks were looking into this and I noticed that much of the change could be refactored into an nfc change which is preferable.

Maybe I just don't see it but I don't get the reason for creating this new function doOutline. Doesn't it basically just call outline? Why can't you just add OutlinedFunctionNum to outline and then call outline in runOnModule?

Please be so kind to clarify this.

It’s possible to get greater size reduction through rerunning the outliner repeatedly. I and a couple other folks were looking into this and I noticed that much of the change could be refactored into an nfc change which is preferable.

I see, thanks!

This revision was automatically updated to reflect the committed changes.