[PATCH] [GlobalMerge] Take into account minsize attribute of global users' parents.

Ahmed Bougacha ahmed.bougacha at gmail.com
Tue May 26 19:13:02 PDT 2015


Hi rengolin, echristo, qcolombet,

Now that we can look at users, we can trivially do this:  when we would have otherwise disabled GlobalMerge (currently -O<3), we can just run it for minsize functions, as it's usually a codesize win (see attached numbers).

I'm a bit uneasy with this minsize/CodeGenOpt::Level hybrid, hence this thread;  alternatives welcome.  Also, minsize only for now, as we're not quite at re-enabling GM everywhere yet (see PR23579).  I'm hoping that if and when we do, we can remove this code path, or turn it into cost model heuristics.

And here are some quick numbers (text section size), for -Oz {no-lto,lto}{AArch64,ARM}:
{F533219}
{F533216}
{F533217}
{F533218}

Most interesting is LTO (esp. ARM), where there's quite a few 5-15% size reductions.  There aren't many regressions, a few ~1-3%.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D10054

Files:
  include/llvm/Transforms/Scalar.h
  lib/CodeGen/GlobalMerge.cpp
  lib/Target/AArch64/AArch64TargetMachine.cpp
  lib/Target/ARM/ARMTargetMachine.cpp
  test/CodeGen/AArch64/global-merge-ignore-single-use-minsize.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10054.26567.patch
Type: text/x-patch
Size: 6521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150527/f7770806/attachment.bin>


More information about the llvm-commits mailing list