This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Confusing description of GCC option `-freorder-blocks'


2014-12-01 17:50 GMT+08:00 Kyrill Tkachov <kyrylo.tkachov@arm.com>:
>> 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.
>
> Cheers,
> Kyrill
>

I see. Thank you very much!
I was misunderstanding branch taken as branch prediction...

Yuan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]