Add support for LTO options: sample_profile, new_pass_manager and debug_pass_manager
Details
Diff Detail
Event Timeline
It should be possible. For new-pass-manger see llvm/test/tools/llvm-lto2/X86/pipeline.ll and for sample-profile see llvm/test/tools/gold/X86/thinlto_afdo.ll
lld/ELF/Config.h | ||
---|---|---|
135 | Remove the default value because it is always overwritten. | |
lld/ELF/Driver.cpp | ||
661 | hasFlag is for a boolean flag such as --foo and --no-foo, and you are supposed to use this as Args.hasFlag(OPT_foo, OPT_no_foo, default-value-which-is-true-or-false) So this is a misuse of the function. The first and the second should be different. You should use Args.hasArg instead. | |
lld/ELF/LTO.cpp | ||
110 | I wouldn't add this comment because this is obvious from the code. | |
lld/ELF/Options.td | ||
398 | HelpText is displayed as part of the --help message, $ ld.lld --help ... --as-needed Only set DT_NEEDED for shared libraries if used --auxiliary <value> Set DT_AUXILIARY field to the specified name --Bdynamic Link against shared libraries --Bshareable Build a shared object ... "New pass manager" doesn't start with a verb, and it is not appropriate as a help message. "Use new pass manager" is better. | |
lld/test/ELF/lto/Inputs/sample.prof | ||
1 ↗ | (On Diff #141209) | What is this file? Is there any way to avoid checking in a binary file? |
lld/test/ELF/lto/Inputs/sample.prof | ||
---|---|---|
1 ↗ | (On Diff #141209) | This is the file for input profile to be used with sample-profile option. Here, it is an input to sample-profile.ll test. For now, it is empty as we just want to test the option. |
lld/test/ELF/lto/Inputs/sample.prof | ||
---|---|---|
1 ↗ | (On Diff #141209) | If an empty file suffices, please use /dev/null instead of a real empty file. |
Peter, are you fine with this change?
lld/test/ELF/lto/new-pass-manager.ll | ||
---|---|---|
4–5 | Don't break this line. |
lld/test/ELF/lto/new-pass-manager.ll | ||
---|---|---|
7 | Added new-pass-manager option to check if Module Pass manager is run. |
LGTM
lld/ELF/LTO.cpp | ||
---|---|---|
108–110 | Nit: I'd move these lines to above line 104 where the rest of the Conf.foo = bar; lines are. |
Remove the default value because it is always overwritten.