Re: Worth balancing the tree before scheduling?

2009-11-25 Thread Daniel Berlin
On Mon, Nov 23, 2009 at 10:17 AM, Ian Bolton wrote: > David Edelsohn wrote: >> On Fri, Nov 20, 2009 at 10:05 AM, Ian Bolton >> wrote: >> > From some simple experiments (see below), it appears as though GCC >> aims >> > to >> > create a lop-sided tree when there are constants involved (func1 >> be

Re: Worth balancing the tree before scheduling?

2009-11-25 Thread Richard Guenther
On Wed, Nov 25, 2009 at 2:52 PM, Bingfeng Mei wrote: > Hello, > It seems to me that tree balancing risk of producing wrong result due > to overflow of subexpression. > > Say a = INT_MIN, b = 10, c = 10, d = INT_MAX. > > If > ((a + b) + c) + d)) > > becomes > ((a + b) + (c + d)) > > c + d will over

RE: Worth balancing the tree before scheduling?

2009-11-25 Thread Bingfeng Mei
Hello, It seems to me that tree balancing risk of producing wrong result due to overflow of subexpression. Say a = INT_MIN, b = 10, c = 10, d = INT_MAX. If ((a + b) + c) + d)) becomes ((a + b) + (c + d)) c + d will overflow and the original won't. So the behaviour of two are different. Thoug

Re: Worth balancing the tree before scheduling?

2009-11-23 Thread Geert Bosch
On Nov 23, 2009, at 10:17, Ian Bolton wrote: > Regardless of the architecture, I can't see how an unbalanced tree would > ever be a good thing. With a balanced tree, you can still choose to > process it in either direction (broad versus deep) - whichever is better > for your architecture - but,

RE: Worth balancing the tree before scheduling?

2009-11-23 Thread Ian Bolton
David Edelsohn wrote: > On Fri, Nov 20, 2009 at 10:05 AM, Ian Bolton > wrote: > > From some simple experiments (see below), it appears as though GCC > aims > > to > > create a lop-sided tree when there are constants involved (func1 > below), > > but a balanced tree when there aren't (func2 below)

Re: Worth balancing the tree before scheduling?

2009-11-20 Thread Richard Earnshaw
On Fri, 2009-11-20 at 10:18 -0500, David Edelsohn wrote: > On Fri, Nov 20, 2009 at 10:05 AM, Ian Bolton wrote: > > From some simple experiments (see below), it appears as though GCC aims > > to > > create a lop-sided tree when there are constants involved (func1 below), > > but a balanced tree wh

Re: Worth balancing the tree before scheduling?

2009-11-20 Thread Richard Guenther
On Fri, Nov 20, 2009 at 4:18 PM, David Edelsohn wrote: > On Fri, Nov 20, 2009 at 10:05 AM, Ian Bolton wrote: >> From some simple experiments (see below), it appears as though GCC aims >> to >> create a lop-sided tree when there are constants involved (func1 below), >> but a balanced tree when the

Re: Worth balancing the tree before scheduling?

2009-11-20 Thread David Edelsohn
On Fri, Nov 20, 2009 at 10:05 AM, Ian Bolton wrote: > From some simple experiments (see below), it appears as though GCC aims > to > create a lop-sided tree when there are constants involved (func1 below), > but a balanced tree when there aren't (func2 below). > > Our assumption is that GCC likes