This has been discussed for a while now, that rerunning the outliner can have some size wins.
So I am posting this change for review to address this.
Special Thanks to Kyungwoo Lee for experimenting on this.
Differential D69446
[llvm][MachineOutliner] Add support for repeating machine outliner N times. plotfi on Oct 25 2019, 12:57 PM. Authored by
Details
This has been discussed for a while now, that rerunning the outliner can have some size wins. Special Thanks to Kyungwoo Lee for experimenting on this.
Diff Detail
Event TimelineComment Actions This is pretty cool, thanks for working on this. This needs a couple tests. A few things I can think of:
I think that the easiest way to test (1) is to add some debug output which we can test. E.g. "did not outline on iteration <iteration> out of <number of iterations>" Also, do you think you could test the code size + compile time impact of this patch on CTMark at -Oz for AArch64? I think that two or three data points would be sufficient. Say, 1 round versus 2 rounds versus 5 rounds versus 10 rounds. (If it turns out that compile time is an issue, I suspect we might be able to save *some* time by keeping track of which functions and basic blocks can never be outlined from, for example.) It would also be nice to know how many rounds on average this provides benefit for. I think 1 iteration is the correct default; this is more for my own curiosity.
Comment Actions I'd actually prefer an option outliner-runs that is defaulted to 1 rather than a rerun option. From a user perspective I'd be unclear what outliner-reruns=0 exactly means? Does that mean one run or zero? As @paquette already said this definitely needs tests for all supported targets. I just want to mention that an outlined function doesn't run through the ordinary lowering passes so some information might be missing that the outliner relies on. A first example that comes to my mind: My patch https://reviews.llvm.org/D69097 introduces return address signing for outlined functions on AArch64 targets. However, these functions currently get signed based on the signing behaviour of candidates rather than their own signing-related function attributes. The outlined functions actually do not even have these attributes. That means a rerun of the outliner would not catch up that the outlined function has been signed and that a new outlined function could also need signing.
|
Could this be renamed to something like machine-outliner-[re]runs? I find an option outliner... to be somewhat ambiguous (there is e.g. outlining during HotColdSpilling) and the prefix machine would be more consistent here.