[patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-02 Thread Kai Tietz
Hello, this patch improves the ability of reassociation pass to simplifiy more complex bitwise-binary operations with comparisons. We break-up for this patch statements like (X | Y) != 0 to X != 0 | Y != 0, and (X | Y) == 0 to expanded X == 0 & Y == 0. Additionally we expand logical-not expressio

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Kai Tietz
Hello, I noticed that I disallowed expansion of ~(X bitwise-binary-ops) for none-boolean type. This limitiation isn't necessary and prevented even some pattern-detections. I've added 3 new testcases for this to the patch. ChangeLog 2011-08-03 Kai Tietz * tree-ssa-reassoc.c (gimple b

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Richard Guenther
On Wed, Aug 3, 2011 at 1:47 PM, Kai Tietz wrote: > Hello, > > I noticed that I disallowed expansion of ~(X bitwise-binary-ops) for > none-boolean type.  This limitiation isn't necessary and prevented > even some pattern-detections. > I've added 3 new testcases for this to the patch. You seem to u

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Michael Matz
Hi, On Tue, 2 Aug 2011, Kai Tietz wrote: > this patch improves the ability of reassociation pass to simplifiy > more complex bitwise-binary > operations with comparisons. We break-up for this patch statements > like (X | Y) != 0 to X != 0 | Y != 0, > and (X | Y) == 0 to expanded X == 0 & Y == 0.

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Kai Tietz
2011/8/3 Michael Matz : > Hi, > > On Tue, 2 Aug 2011, Kai Tietz wrote: > >> this patch improves the ability of reassociation pass to simplifiy >> more complex bitwise-binary >> operations with comparisons.  We break-up for this patch statements >> like (X | Y) != 0 to X != 0 | Y != 0, >> and (X | Y

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Richard Guenther
On Wed, Aug 3, 2011 at 3:32 PM, Kai Tietz wrote: > 2011/8/3 Michael Matz : >> Hi, >> >> On Tue, 2 Aug 2011, Kai Tietz wrote: >> >>> this patch improves the ability of reassociation pass to simplifiy >>> more complex bitwise-binary >>> operations with comparisons.  We break-up for this patch statem

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Michael Matz
Hi, On Wed, 3 Aug 2011, Kai Tietz wrote: > > Implement all of this in the normal reassoc machinery that already > > exists. Don't implement your own walker (which btw is superlinear > > because you recurse into both operands).  If no simplifications were > > possible you have to fold back the

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-03 Thread Kai Tietz
2011/8/3 Michael Matz : > Hi, > > On Wed, 3 Aug 2011, Kai Tietz wrote: > >> > Implement all of this in the normal reassoc machinery that already >> > exists. Don't implement your own walker (which btw is superlinear >> > because you recurse into both operands).  If no simplifications were >> > poss

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-04 Thread Kai Tietz
2011/8/3 Richard Guenther : > On Wed, Aug 3, 2011 at 3:32 PM, Kai Tietz wrote: >> 2011/8/3 Michael Matz : >>> Hi, >>> >>> On Tue, 2 Aug 2011, Kai Tietz wrote: >>> this patch improves the ability of reassociation pass to simplifiy more complex bitwise-binary operations with compariso

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-08-04 Thread Michael Matz
Hi, On Wed, 3 Aug 2011, Kai Tietz wrote: > >> This machinery doen't work in this case > > > > That's why you have to extend it. > > The issue about this machinery is that it assumes that the statement > itself gets transformed, but for normalized form of invert of bitwise > operations it is es

Re: [patch tree-optimization]: Improve reassociation pass for bitwise-operations

2011-09-21 Thread Kai Tietz
Hello, This revised patch adds support to tree-ssa-reassoc for intial normalizing of bitwise operation. So the reassociation pass is able to have better folding result. Also it has a final denormalzing of bitwise-operations after reassociation pass is completed to restore optimized writing. This