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

2020-08-27 Thread Scott Shawcroft via Phabricator via cfe-commits
tannewt added a comment. Is this superseded by: https://reviews.llvm.org/D79919 ? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63976/new/ https://reviews.llvm.org/D63976 ___ cfe-commits mailing list

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

2019-11-20 Thread Troy Johnson via Phabricator via cfe-commits
troyj added a comment. I ran into this same problem and would like to see this patch or a similar one land. Note that there is also a -Og option to consider, which currently has the same problem. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63976/new/

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

2019-08-06 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. > 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

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

2019-08-06 Thread Steven Noonan via Phabricator via cfe-commits
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

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

2019-08-06 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. > I assume I might be missing something here, though, since someone mentioned > this above (I don't understand the response to it though). There are two invocations in LTO: the first phase where we compile from source to bitcode, and the second phase which is

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

2019-08-06 Thread Steven Noonan via Phabricator via cfe-commits
tycho added a comment. Two things: - I'm curious why we would want to force `-O2`/`-O3` instead of just allowing `-Os`/`-Oz` to be used with LTO. Is optimizing for size combined with LTO really that unusual? I've built several projects using GCC with `-Os -flto` and the size reduction over

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

2019-07-02 Thread Mehdi AMINI via Phabricator via cfe-commits
mehdi_amini added a comment. In D63976#1566236 , @ruiu wrote: > I agree with Teresa. I don't think automatically setting O3 > for Os and Oz is a good idea > because these three options are different (that's

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

2019-07-02 Thread Rui Ueyama via Phabricator via cfe-commits
ruiu added a comment. I agree with Teresa. I don't think automatically setting O3 for Os and Oz is a good idea because these three options are different (that's why we have three different options in the first place). Adding an Os and Oz to lld's

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

2019-06-29 Thread Teresa Johnson via Phabricator via cfe-commits
tejohnson added inline comments. Comment at: llvm-9.0.0-20190629/clang/lib/Driver/ToolChains/CommonArgs.cpp:395 + if(OOpt == "s" || OOpt == "z") +OOpt = "3"; +} Os/Oz are closer to O2 than O3 (which allows much more aggressive code size

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

2019-06-29 Thread Stephen Checkoway via cfe-commits
> On Jun 29, 2019, at 15:38, Bernhard Rosenkränzer via Phabricator via > llvm-commits wrote: > > bero created this revision. > bero added a reviewer: llvm-commits. > bero added a project: clang. > Herald added subscribers: cfe-commits, dexonsmith, inglorion, mehdi_amini. > > Fix clang

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

2019-06-29 Thread Dávid Bolvanský via Phabricator via cfe-commits
xbolva00 added a comment. Good idea, I found this issue a few days ago too. Please upload the patch with a full context. Plesse try to add a testcase. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63976/new/ https://reviews.llvm.org/D63976

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

2019-06-29 Thread Bernhard Rosenkränzer via Phabricator via cfe-commits
bero created this revision. bero added a reviewer: llvm-commits. bero added a project: clang. Herald added subscribers: cfe-commits, dexonsmith, inglorion, mehdi_amini. Fix clang -Os/-Oz with LTO $ clang -Os -fuse-ld=lld -flto test.c ld.lld: error: -plugin-opt=Os: number expected, but got 's'