[lkml]   [2015]   [Apr]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] x86: Turn off GCC branch probability heuristics
On Sat, Apr 11, 2015 at 11:57 AM, Thomas Gleixner <> wrote:
> I thinks its just the no-guess one:
> text data dec patch reduction
> 7563475 1781048 10302987
> 7192973 1780024 9931461 no-guess -4.8%
> 7354819 1781048 958464 align-1 -2.7%
> 7192973 1780024 9931461 no-guess + align-1 -4.8%

Yeah, a 5% code expansion is a big deal. Sadly, it looks like
'no-guess' also disables our explicit likely/unlikely handling.

Damn. If it actually honored likely/unlikely, then we should just do
it - and manually fix up any places where we really care.

But the fact that it apparently entirely disables not just the
guesses, but our *explicit* likely/unlikely, means that we can't fix
up the mistakes.

And in many of the hot codepaths that likely/unlikely really does
matter. Some of our hottest paths have known "this basically never
happens" situations that we do *not* want to break up our L1 I$ over.
There's a number of functions that have been optimized to really
generate good code, and "-fno-guess-branch-probability" disables those
manual optimizations.

So we'd have no way to fix it for the cases that matter.


It might be worth bringing this up with some gcc people. I added Jakub
to the cc. Any other gcc people suggestions?


 \ /
  Last update: 2015-04-11 21:41    [W:0.188 / U:4.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site