This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Branch taken rate of Linux kernel compiled with GCC 4.9
- From: Pengfei Yuan <0xcoolypf at gmail dot com>
- To: Paul_Koning at dell dot com
- Cc: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Tue, 13 Jan 2015 22:25:04 +0800
- Subject: Re: Branch taken rate of Linux kernel compiled with GCC 4.9
- Authentication-results: sourceware.org; auth=none
- References: <CACmZjJLQK6y6+X-57BWmC9W-hfmaBe57ZVXrhqHKEUyW=WHatQ at mail dot gmail dot com> <alpine dot LNX dot 2 dot 11 dot 1501131541120 dot 20322 at monopod dot intra dot ispras dot ru> <32784E1D-81AA-4257-89B8-F16197AD92E7 at dell dot com>
Actually GCC does not help reduce branch misprediction rate on modern
X86 processors.
Reducing branch taken rate is more important.
Related discussion: https://gcc.gnu.org/ml/gcc/2014-12/msg00000.html
Yuan
2015-01-13 22:13 GMT+08:00 <Paul_Koning@dell.com>:
> Depending on what the processor hardware can do, the data you need is the branch mispredict rate. A lot of processors will predict forward branches not taken, reverse branches taken, and I believe GCC optimizes that way. (Some processors are different: MC68040 predicts all branches taken no matter what direction!) If the mispredict rate is unreasonably high, then that might indeed suggest missed optimizations.
>
> paul