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

2011-11-12 Thread Kai Tietz
2011/11/10 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 express

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

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

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 wrote: > 2011/11/10 Richard Guenther : >> On Wed, Nov 9, 2011 at 10:09 PM, Kai Tietz wrote: >>> 2011/11/9 Jeff Law : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:36, Richard Guenther wrote: > > Yes.  tree

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

2011-11-10 Thread Kai Tietz
2011/11/10 Richard Guenther : > On Wed, Nov 9, 2011 at 10:09 PM, Kai Tietz wrote: >> 2011/11/9 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 +

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 wrote: > 2011/11/9 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 i

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 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 or

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

2011-11-09 Thread Kai Tietz
2011/11/9 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-

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.

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

2011-11-08 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/07/11 15:42, Richard Guenther wrote: > > IIRC valgrind even offers simple branch predictor simulation - well > predicted branches tend to be cheap. It does. The predictor is based on processors that are 5-7 years old. I don't generally look c

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 consisten

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 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

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 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 Kai Tietz
2011/11/7 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_

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 (t

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 cann

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 wrote: > 2011/11/7 Richard Guenther : >> On Sun, Nov 6, 2011 at 11:12 PM, Kai Tietz 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 optimizatio

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

2011-11-07 Thread Kai Tietz
2011/11/7 Richard Guenther : > On Sun, Nov 6, 2011 at 11:12 PM, Kai Tietz 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

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 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 > branch-cost

[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 int