This is the mail archive of the
mailing list for the GCC project.
Re: Confusing description of GCC option `-freorder-blocks'
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: Pengfei Yuan <0xcoolypf at gmail dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Mon, 01 Dec 2014 09:50:40 +0000
- Subject: Re: Confusing description of GCC option `-freorder-blocks'
- Authentication-results: sourceware.org; auth=none
- References: <CACmZjJJ9sG5G1DmxGzxBZGNrO+DHCkbyk6gGMd77YojdG8PHmQ at mail dot gmail dot com>
On 01/12/14 08:20, Pengfei Yuan wrote:
In https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html , the
description of option `-freorder-blocks' says `in order to reduce
number of taken branches and improve code locality'. It is confusing.
When will the `and' condition happen? That is, taken branches reduced
AND code locality improved.
I would think that one implies the other. If you reorder the blocks
so as to reduce taken branches, that is by definition an improvement of
code locality since you don't jump all over the place as much.