Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-12 Thread Kai Tietz
2011/11/10 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/09/11 14:09, Kai Tietz wrote: Well, such a comparison-logic-folder helper - like affine-tree for add/subtract/scale) - is for sure something good for inner gimple passes building up new logic-truth

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-11 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 13:28, Kai Tietz wrote: Sure. A more general question, which was raised by Richi here. For BC optimization it is of course interesting to know real instruction-costs and not just guessings. The current code in fold-const guess a

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-10 Thread Richard Guenther
On Wed, Nov 9, 2011 at 7:34 PM, Jeff Law l...@redhat.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: Yes.  tree-affine does this for a sum of expressions of the form a + b * c. It collects such sum, optimizes it (and you can add/subtract

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-10 Thread Richard Guenther
On Wed, Nov 9, 2011 at 10:09 PM, Kai Tietz ktiet...@googlemail.com wrote: 2011/11/9 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: Yes.  tree-affine does this for a sum of expressions of the form a + b * c. It collects

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-10 Thread Kai Tietz
2011/11/10 Richard Guenther richard.guent...@gmail.com: On Wed, Nov 9, 2011 at 10:09 PM, Kai Tietz ktiet...@googlemail.com wrote: 2011/11/9 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: Yes.  tree-affine does this for a

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-10 Thread Richard Guenther
On Thu, Nov 10, 2011 at 11:49 AM, Kai Tietz ktiet...@googlemail.com wrote: 2011/11/10 Richard Guenther richard.guent...@gmail.com: On Wed, Nov 9, 2011 at 10:09 PM, Kai Tietz ktiet...@googlemail.com wrote: 2011/11/9 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-10 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/09/11 14:09, Kai Tietz wrote: Well, such a comparison-logic-folder helper - like affine-tree for add/subtract/scale) - is for sure something good for inner gimple passes building up new logic-truth expressions, but such a pass doesn't

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-09 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: Yes. tree-affine does this for a sum of expressions of the form a + b * c. It collects such sum, optimizes it (and you can add/subtract or scale these things) and re-emit the new simplified form. Kai,

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-09 Thread Kai Tietz
2011/11/9 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: Yes.  tree-affine does this for a sum of expressions of the form a + b * c. It collects such sum, optimizes it (and you can add/subtract or scale these things) and

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-08 Thread Kai Tietz
Hi, with not much hope that this patch gets into 4.7 version, resent revised version for the first part of patch. I updated the patch according to comments I got by matz on IRC yesterday. Patch uses now vector for collecting truth /|'s conditional chain. Additionally it checks now

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Richard Guenther
On Sun, Nov 6, 2011 at 11:12 PM, Kai Tietz kti...@redhat.com wrote: Hello, By this patch branch-cost optimization is moved from tree AST to cfgexpand from gimple to RTL.  By this we are able to do better optimization on conditionals simliar for all targets and do the final transition for

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Kai Tietz
2011/11/7 Richard Guenther richard.guent...@gmail.com: On Sun, Nov 6, 2011 at 11:12 PM, Kai Tietz kti...@redhat.com wrote: Hello, By this patch branch-cost optimization is moved from tree AST to cfgexpand from gimple to RTL.  By this we are able to do better optimization on conditionals

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Richard Guenther
On Mon, Nov 7, 2011 at 4:53 PM, Kai Tietz ktiet...@googlemail.com wrote: 2011/11/7 Richard Guenther richard.guent...@gmail.com: On Sun, Nov 6, 2011 at 11:12 PM, Kai Tietz kti...@redhat.com wrote: Hello, By this patch branch-cost optimization is moved from tree AST to cfgexpand from gimple

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 09:14, Richard Guenther wrote: Well, not that I noticed that I missed here any freedom. In what cases you mean I would need here freedom to create new ssa-statements? You lookup SSA_NAME_DEF_STMTs of SSA names - you cannot do

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 07:38, Richard Guenther wrote: The cond_chain stuff should be as we have discussed quite some time ago on IRC - modeled after tree-affine.c - a vector of predicates of the form [~] A op B, combined using logical AND or OR (thus,

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Kai Tietz
2011/11/7 Jeff Law l...@redhat.com: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 09:14, Richard Guenther wrote: Well, not that I noticed that I missed here any freedom.  In what cases you mean I would need here freedom to create new ssa-statements? You lookup

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Richard Guenther
On Mon, Nov 7, 2011 at 8:47 PM, Jeff Law l...@redhat.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 07:38, Richard Guenther wrote: The cond_chain stuff should be as we have discussed quite some time ago on IRC - modeled after tree-affine.c - a vector of predicates of

Re: [patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-07 Thread Richard Guenther
On Mon, Nov 7, 2011 at 8:36 PM, Jeff Law l...@redhat.com wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 09:14, Richard Guenther wrote: Well, not that I noticed that I missed here any freedom.  In what cases you mean I would need here freedom to create new ssa-statements?

[patch tree-optimization 1/2]: Branch-cost optimizations

2011-11-06 Thread Kai Tietz
Hello, By this patch branch-cost optimization is moved from tree AST to cfgexpand from gimple to RTL. By this we are able to do better optimization on conditionals simliar for all targets and do the final transition for branch-cost that late it shows best effect. This patch is splitted up