2014-12-01 17:50 GMT+08:00 Kyrill Tkachov <kyrylo.tkac...@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