Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2014-11-13 Thread Richard Biener
On Thu, Jun 20, 2013 at 2:52 PM, Jeff Law wrote: > On 06/20/2013 04:49 AM, Andreas Schwab wrote: >> >> Jeff Law writes: >> >>> +/* { dg-final { scan-tree-dump-times "Replaced" 8 "forwprop1"} } */ >> >> >> $ grep -c Replaced forwprop-28.c.022t.forwprop1 >> 16 >> >> ;; Function test (test, funcdef_

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-20 Thread Jeff Law
On 06/20/2013 04:49 AM, Andreas Schwab wrote: Jeff Law writes: +/* { dg-final { scan-tree-dump-times "Replaced" 8 "forwprop1"} } */ $ grep -c Replaced forwprop-28.c.022t.forwprop1 16 ;; Function test (test, funcdef_no=0, decl_uid=1388, symbol_order=0) Replaced 'rotate_7 == 0' with '_6 =

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-20 Thread Andreas Schwab
Jeff Law writes: > +/* { dg-final { scan-tree-dump-times "Replaced" 8 "forwprop1"} } */ $ grep -c Replaced forwprop-28.c.022t.forwprop1 16 ;; Function test (test, funcdef_no=0, decl_uid=1388, symbol_order=0) Replaced 'rotate_7 == 0' with '_6 == 0' Replaced '_6 == 0' with 'code_5(D) != 22'

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Jeff Law
On 06/19/2013 10:02 AM, Bernhard Reutner-Fischer wrote: On 19 June 2013 15:57, Jeff Law wrote: On 06/19/2013 01:02 AM, Chung-Ju Wu wrote: 2013/6/19 Jeff Law : * gcc.dg/tree-ssa/forwprop-28.c: New test. In the gnu coding standard we have a space before the open-parentheses. Wo

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Bernhard Reutner-Fischer
On 19 June 2013 15:57, Jeff Law wrote: > On 06/19/2013 01:02 AM, Chung-Ju Wu wrote: >> >> 2013/6/19 Jeff Law : >>> >>> >>> * gcc.dg/tree-ssa/forwprop-28.c: New test. >>> >> >> In the gnu coding standard we have a space before >> the open-parentheses. Would that be great to have >> testca

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Jeff Law
On 06/19/2013 01:02 AM, Chung-Ju Wu wrote: 2013/6/19 Jeff Law : * gcc.dg/tree-ssa/forwprop-28.c: New test. In the gnu coding standard we have a space before the open-parentheses. Would that be great to have testcase follow this convention as well? :) If so, then... No reason not t

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Richard Biener
On Wed, Jun 19, 2013 at 6:08 AM, Jeff Law wrote: > > The notable changes since the last version: > > First, it should properly handle signed single bit types, though I haven't > tested it with real code. > > Second, the transformation is only applied when the result is used in a > conditional. Th

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Chung-Ju Wu
2013/6/19 Jakub Jelinek : > On Wed, Jun 19, 2013 at 03:02:38PM +0800, Chung-Ju Wu wrote: >> In the gnu coding standard we have a space before >> the open-parentheses. Would that be great to have >> testcase follow this convention as well? :) >> >> If so, then... > > Testcases generally don't need

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Jakub Jelinek
On Wed, Jun 19, 2013 at 03:02:38PM +0800, Chung-Ju Wu wrote: > In the gnu coding standard we have a space before > the open-parentheses. Would that be great to have > testcase follow this convention as well? :) > > If so, then... Testcases generally don't need to follow the coding conventions, t

Re: [PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-19 Thread Chung-Ju Wu
2013/6/19 Jeff Law : > > * gcc.dg/tree-ssa/forwprop-28.c: New test. > In the gnu coding standard we have a space before the open-parentheses. Would that be great to have testcase follow this convention as well? :) If so, then... > > diff --git a/gcc/testsuite/gcc.dg/tree-ssa/forwprop-28

[PATCH] Improve folding of bitwise ops feeding conditionals for single bit types

2013-06-18 Thread Jeff Law
The notable changes since the last version: First, it should properly handle signed single bit types, though I haven't tested it with real code. Second, the transformation is only applied when the result is used in a conditional. Thus it's much less likely to pessimize targets with and-not