This commits add a --lto-newpm-passes= option that can specify the set of passes that need to be run (similarly to what opt already does). This makes testing easier (e.g. tuning the LTO pipeline), among others.
runLTOPasses() is growing (maybe) too much. I can split in two separate functions, if you like that better.
Details
Diff Detail
Event Timeline
git-clang-formatted.
Also, this doesn't still allow to specify an AliasAnalysis pipeline (a-la opt). I'll introduce another option for that in a subsequent commit.
Ideally we wouldn't need two different options, but the current architecture doesn't allow to get away with a single option, to the best of my knowledge.
ELF/LTO.cpp | ||
---|---|---|
134–142 | We should really refactor this into a helper in PassBuilder. |
FWIW, this looks good to me, but you should get someone who works on LLD to give the final LGTM.
ELF/LTO.cpp | ||
---|---|---|
112–129 | Can you please split the function so that you can do if (!Config->LtoNewPmPasses.empty()) runNewLtoPasses(M, TM); else runOldLtoPasses(M, TM); | |
140–141 | You need to handle the error gracefully (i.e. don't call fatal which exits) as it is a user-supplied command line option. Instead, please call error() here. Please add a test to verify that it prints out an error message for an unknown --lto-newpm-passes argument. |
ELF/LTO.cpp | ||
---|---|---|
112–129 | I don't want to bikeshed, but. |
ELF/LTO.cpp | ||
---|---|---|
112–129 | Maybe your name is better. :) My point was just to split the function. |
Thanks for your review, Rui/Chandler. I'll let this bake in the tree for a bit and then implement --lto-newpm-aa-pipeline (as opt does).
Fix indentation of this code.