[PATCH] D63976: Allow clang -Os and -Oz to work with -flto and lld

Steven Noonan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 6 11:17:15 PDT 2019


tycho added a comment.

OK, that makes sense. So this change would not enforce `-O2`/`-O3` for the bitcode emission, but would enforce one of the two for the LTO phase.

This may be a stupid question, but aren't there some optimization passes that can emit functions during the LTO phase that weren't in the initial bitcode compile? If so, wouldn't those miss out on getting the `-Os`/`-Oz` function attributes applied?

What would happen after D63976 <https://reviews.llvm.org/D63976> is applied with a funny command line like `clang -Oz -flto -o foo a.o b.c`, where one (or all) of the input arguments is a source file? Would it invoke the bitcode compile of the source files with the requested `-Oz` and then invoke the LTO linker plugin with `-O2`/`-O3`?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63976/new/

https://reviews.llvm.org/D63976





More information about the cfe-commits mailing list