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



Yuri Rumyantsev <ysrumyan at gmail dot com> changed:



           What    |Removed                     |Added

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

                 CC|                            |ysrumyan at gmail dot com



--- Comment #7 from Yuri Rumyantsev <ysrumyan at gmail dot com> 2013-02-14 
14:49:31 UTC ---

My 2 cents.



We can enhance if conversion phase in gcc by analyzing conditional jump

probablity and if we have skewed hammock do not perform transformation. In

general it requires to use profiling but for this specific example we can use

so called "static profiler", e.g. in our example we have 

    if (tmp >= imax) 

where imax = 1 << 32, i.e. huge conastant. For such conditions we can assume

that this branch is likely not-taken and reject if-conversion of such hammock.



Other possiblity is implement support for __builtin_expect in gcc but it

requires source code changing too.

Reply via email to