[LLVMbugs] [Bug 21201] Missed optimization by O2? LTO generates faster code than O2 with all code visible

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Oct 17 12:19:54 PDT 2014


Bruno Cardoso Lopes <bruno.cardoso at gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
                 CC|                            |bruno.cardoso at gmail.com
         Resolution|---                         |INVALID

--- Comment #2 from Bruno Cardoso Lopes <bruno.cardoso at gmail.com> ---
These are the results reproduced locally:
flags, random, in-order
tot-O2, 722.680343, 358.527025
tot-O2-flto, 586.257256, 113.567324
tot-O3, 763.348347, 340.556150

The only passes that run in LTO but do not run during non-LTO compilation are:

-argpromotion, -globalsmodref-aa, -internalize

The great responsible for the speedup is indeed -internalize, results bellow: 

== llvm-lto flags, random, in-order
default, 551.342890, 107.292317
-nointernalize, 811.046609, 420.142491
-nointernalize-noglobalsmodref-aa, 779.453545, 412.112992
-nointernalize-noglobalsmodref-aa-noargsprom, 825.279406, 433.142810

Note that removing other passes yield the same results - the values above
all fall within the -nointernalize SD. With -internalize we're able to
delete 20 functions and inline 43, see the stats:

== llvm-lto
64 internalize       - Number of functions internalized
50 internalize       - Number of global vars internalized
150 inline            - Number of caller-callers analyzed
 20 inline            - Number of functions deleted because all callers found
 43 inline            - Number of functions inlined

== llvm-lto without -internalize 
no internalize results
no inline results

That said, nothing to do here anymore since -internalize only makes sense
during LTO.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141017/dc3bf741/attachment.html>

More information about the llvm-bugs mailing list