[Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.

carrot at google dot com gcc-bugzilla@gcc.gnu.org
Thu Apr 29 02:24:00 GMT 2010



------- Comment #4 from carrot at google dot com  2010-04-29 02:23 -------
It is not only good to code size, but also benefit performance. For any path to
any successor block, the same number of taken branch executed, but less alu
instructions executed.

It may be difficult to calculate the tradeoff for an arbitrary condition
expression. But for a condition composed of a series of || or && operation,
such as
    if (A || B || C || ...)
or 
    if (A && B && C && ...)
This simplification is always beneficial.


-- 


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



More information about the Gcc-bugs mailing list