[llvm-commits] [PATCH] Add an attribute for Oz related optimizations

Quentin Colombet qcolombet at apple.com
Thu Oct 18 11:36:00 PDT 2012


On Oct 18, 2012, at 11:25 AM, Eli Friedman <eli.friedman at gmail.com> wrote:

> On Thu, Oct 18, 2012 at 11:01 AM, Quentin Colombet <qcolombet at apple.com> wrote:
>> Hi,
>> 
>> The attached patch is the first step to have a better control on Oz related optimizations.
>> The Oz optimization level focuses on code size, thus I propose to add an attribute called ForceSizeOpt.
>> 
>> The idea would be to set this attribute to all functions when the Oz optimization level is On (modification not available in this patch) and slowly tune the existing optimizations according to this attribute.
>> 
>> This is my first patch to llvm, so do not hesitate to make comments please.
> 
> What optimizations in particular are you planning on changing?

Right now, I am thinking of target specific optimization.
For instance, you can see this piece of code in lib/Target/ARM/Thumb2SizeReduction.cpp:
  // FIXME: Disable check for -Oz (aka OptimizeForSizeHarder).
  if (!STI->avoidCPSRPartialUpdate())
    return false;

-Quentin

> 
> -Eli




More information about the llvm-commits mailing list