[llvm-commits] [PATCH] optsize attribute on top of -Oz gives bigger code

Bill Wendling wendling at apple.com
Thu Mar 22 00:09:49 PDT 2012


Hi Patrik,

The patch looks okay overall. Could you give some metrics to go along with the patch? You should be able to measure the impact on the LLVM test suite.

A comment on the patch itself:

+  if (!(InlineLimit.getNumOccurrences() > 0) && OptSize && OptSizeThreshold < thres)

The logic could be made better (and more readable). Please use this instead:

+  if (OptSize && OptSizeThreshold < thres && InlineLimit.getNumOccurrences() == 0)

-bw

On Mar 20, 2012, at 6:30 AM, Patrik Hägglund H wrote:

> Hi,
> 
> I found that using clang -Oz, used as a backend for .ll files, combined with using the optsize attribute, then optsize _increased_ the code size.
> 
> The base inline threshold was 25 with clang -Oz, but 75 when adding the optsize attribute.
> 
> This patch fix this to only change the inline threshold for a function with optsize if it lowers the base threshold.
> 
> /Patrik Hägglund
> 
> <optsize_inliner.diff>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list