50% slowdown with LTO

2012-08-13 Thread Paul_Koning
I'm not sure what LTO is supposed to do -- the documentation is not exactly clear. But I assumed it should make things faster and/or smaller. So I tried using it on an application -- a processor emulator, CPU intensive code, a lot of 64 bit integer arithmetic. Using a compile/assembler run on

Re: 50% slowdown with LTO

2012-08-13 Thread Ian Lance Taylor
On Mon, Aug 13, 2012 at 8:27 AM, paul_kon...@dell.com wrote: I'm not sure what LTO is supposed to do -- the documentation is not exactly clear. But I assumed it should make things faster and/or smaller. So I tried using it on an application -- a processor emulator, CPU intensive code, a

Re: 50% slowdown with LTO

2012-08-13 Thread Andi Kleen
Ian Lance Taylor i...@google.com writes: Figuring out what has gone wrong is like optimizing any program. Get a profile for your program, e.g., using -pg. Build the program with and without -flto, run it, and look at the resulting profiles. A 50% slowdown should be fairly obvious. I would