llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.03k stars 11.97k forks source link

Performance regression when LTO is enabled #20378

Open llvmbot opened 10 years ago

llvmbot commented 10 years ago
Bugzilla Link 20004
Version 3.4
OS MacOS X
Reporter LLVM Bugzilla Contributor
CC @rotateright

Extended Description

Without LTO:

clang PerformanceTest.cpp dsp.cpp -std=c++11 -ffast-math -O3 -o PerformanceTest

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.2.0 Thread model: posix

Iterations: 955 C results: 100,043,846 shorts per second.

With LTO:

clang PerformanceTest.cpp dsp.cpp -std=c++11 -ffast-math -flto -O3 -o PerformanceTest

Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin13.2.0 Thread model: posix

Iterations: 586 C results: 61,349,033 shorts per second.

Code can be downloaded from here: https://gist.github.com/learnopengles/004ff4eee75057ca006c

llvmbot commented 8 years ago

I'm running into a similar problem with Freecell Solver’s git master on Mageia Linux x86-64 Cauldron with clang-3.7.1-4.mga6. Using clang, I am getting a 9.00627183914185 seconds runtime without -flto and a 9.06325387954712 seconds with it (and with -fuse-ld=gold). Based on my post of https://groups.yahoo.com/neo/groups/fc-solve-discuss/conversations/messages/1442 the difference used to be much more dramatic in the past.

llvmbot commented 9 years ago

This LTO regression also exists on 3.6.