This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
- From: "carrot at google dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Apr 2010 02:23:54 -0000
- Subject: [Bug target/43920] Choosing conditional execution over conditional branches for code size in some cases.
- References: <bug-43920-17659@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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