[RFC, PATCH] Disable -fprofile-use related optimizations if corresponding .gcda file not found.

Maxim Ostapenko m.ostapenko@partner.samsung.com
Wed Oct 7 16:11:00 GMT 2015


Hi,

when testing OpenSSL performance, I found out that sometimes PGO-built 
binaries can actually introduce performance regressions. We could 
identify affected object files and disable PGO for them by simply 
removing corresponding .gcda file. However, even if profile data is not 
presented, GCC doesn't switch back -fprofile-use dependent optimizations 
(e.g. -fbranch-probabilities, -fvpt, etc). This may also lead to 
performance degradations.

The issue had already raised quite time ago 
(https://gcc.gnu.org/ml/gcc-patches/2009-09/msg02119.html), but for some 
reasons wasn't discussed.

Here a draft patch that disables -fprofile-use related optimizations if 
profile data wasn't found (perhaps it makes sense to introduce a special 
switch for this?). Does this look reasonable?

Thanks,
-Maxim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: disable_profile_optimizations-4.diff
Type: text/x-patch
Size: 1416 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20151007/50e4ede0/attachment.bin>


More information about the Gcc-patches mailing list