[PATCH] After llvm r195496, code compiled with -Os get substantially larger

Dimitry Andric dimitry at andric.com
Sat Oct 18 12:46:17 PDT 2014


On 18 Oct 2014, at 21:30, Tim Northover <t.p.northover at gmail.com> wrote:
> 
> Hi Dimitry,
> 
>> In FreeBSD, we have a particular piece of code, a boot loader, which must always fit in 7 kiB, so it is compiled with -Os, and various other parameters that minimize its size.
> 
> That kind of hard size requirement sounds like what -Oz was designed for.

Yes, I saw the option, but in my case it makes the code *bigger* than with -Os.  So it does not help at all. :(


> Lots of people use -Os as the default optimisation level, and it's
> supposed to be more balanced. Given the large performance benefits and
> small size penalties mentioned in the original thread, I'm not so sure
> about switching this one.

In this case I'm just a user, who saw a change in the behavior of -Os.  This change seems to fix it partially, at least for me.

(Note that I'm bisecting for yet another size optimization regression, so I'll probably post another diff for review soonish.)

-Dimitry





More information about the llvm-commits mailing list