http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54073



Jan Hubicka <hubicka at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

                 CC|                            |hubicka at gcc dot gnu.org



--- Comment #12 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-13 
15:54:22 UTC ---

The decision on whether to use cmov or jmp was always tricky on x86

architectures. Cmov increase dependency chains, register pressure (both values

needs to be loaded in) and has long opcode. So jump sequence, if well

predicted, flows better through the out-of-order core. If badly predicted it

is, of course, a disaster. I think more modern CPUs solved the problems with

long latency of cmov, but the dependency chains are still there.



This patch fixes a bug in a pattern rather than tweaks heuristic on

predictability. As such I think it is OK for mainline. 



We should do something about rnflow. I will look into that.

The usual wisdom is that lacking profile feedback one should handle non-loop

branhces as inpredctable and loop branches as predictable, so all handled by

ifconvert fals to the first category. With profile feedback one can see branch

probability and if it is close to 0 or REG_BR_PROB_BASE tread the branch as

predictable. We handle this with predictable_edge_p parameter passed to

BRANCH_COST (that by itself is a gross, but for years we was not able to come

with something saner)



Honza

Reply via email to