This is an archive of the discontinued LLVM Phabricator instance.

[NFCi] Iterative Outliner + clang-format refactoring.
ClosedPublic

Authored by plotfi on Apr 29 2020, 12:44 AM.

Details

Summary

Prior to D69446 I had done some NFC cleanup to make landing an iterative outliner a cleaner more straight-forward patch. Since then, it seems that has landed but I noticed some ways it could be cleaned up. Specifically:

  1. doOutline was meant to be the re-runable function, but instead runOnceOnModule was created that just calls doOutline.
  1. In D69446 we discussed that the flag allowing the re-run of the outliner should be a flag to tell how many additional times to run the outliner again, not the total number of times. I don't think it makes sense to introduce a flag, but print an error if the flag is set to 0.

This is an NFCi, the i being that I get rid of the way that the machine-outline-runs flag could be used to tell the outliner to not run at all, and because I renamed the flag to '-machine-outliner-reruns'.

Diff Detail

Event Timeline

plotfi created this revision.Apr 29 2020, 12:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 29 2020, 12:44 AM
thegameg accepted this revision.Apr 29 2020, 10:45 AM

Looks pretty straightforward. Thanks!

This revision is now accepted and ready to land.Apr 29 2020, 10:45 AM
paquette added inline comments.Apr 29 2020, 10:54 AM
llvm/lib/CodeGen/MachineOutliner.cpp
100–106
  • s/if/of/
  • total number of runs
llvm/test/CodeGen/AArch64/machine-outliner-iterative-2.mir
21

noredzone can be passed in MachineModuleInfo now, so you shouldn't need any IR.

see llvm/test/CodeGen/AArch64/function-info-noredzone-present.ll for an example

26

Maybe it would be better to do this with a regex?
e.g.

BL @OUTLINED_FUNCTION_[[FUNC1:[0-9]+]]

42–50

can just delete this I think

51

can just delete this too I think

56

If you change everything this:

(store 8 into %stack.1)

into this:

(store 8)

you can remove some references to the IR. This, in combination with putting the redzone attribute in the MIR, should allow you to delete the IR entirely.

94–103

can probably just delete this

plotfi updated this revision to Diff 261027.Apr 29 2020, 2:11 PM

Updated based on @paquette's feedback

plotfi marked 7 inline comments as done.Apr 29 2020, 2:12 PM
This revision was automatically updated to reflect the committed changes.