This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [cfg-branch] branch combining code


> On Mon, Nov 26, 2001 at 12:58:55PM +0100, Jan Hubicka wrote:
> > this patch adds promised support for combining two conditionals into same
> > destination, such as those created from (cond1 || cond2) and (cond1 && cond2)
> > type of statements into ifcvt.c
> 
> There is code to do this in fold-const.c.  Why isn't it working?
Just because it is not incommon to create such
cases from multiple expressions and statements (such as chined ifsfor example).

I am targetting less trivial converisons, that do depend on the hardware
features (such as presence of store flags or predicate registers) and branch
probabilities (for instace on x86 I can convert tests (a!=5 || b!=7) to
((a^5)|(b^7)) with benefit in case the first conditional is inprobable enought.

I believe if converison is better place for such a tricks, than tree based
optimizers (even when there it is easier to implement the infrastructure).  IMO
It is like why we are not generating conditional moves by folding if (cond)
x=y; statements.

Honza
> 
> 
> r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]