This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [tree-ssa] Temporary Expression Replacement in SSA->normal.


On Sat, Dec 13, 2003 at 11:56:36AM -0500, Daniel Berlin wrote:
> >
> >I'll admit that I'm not sure.  If SSA CCP can optimize
> >
> >T.1 = A + B
> >T.2 = T.1 + C
> >T.3 = T.2 + D
> >T.4 = T.3 - A
> >
> >then I'd be impressed.  It's not impossible, just that I don't think
> >that deep reassociation is currently implemented.
> 

True, the symbolic deep reassociation is not implemented, but this is
not the role of the CCP.

> It's not a matter of reassociation in this case, it's a matter of 
> tracking the values.
> 

The CCP propagates scalar values as far as possible in the program; it
works only when a scalar value can be associated to a symbolic name,
in other words, it is not the role of the CCP to perform the symbolic
reassociation.

In my opinion it is the folder that has to symbolically reduce these
expressions.  However the folder does not implement the reassociation.
As an example, consider the dependence test for:

  X[2*N + 1] = ...
  ... = X[2*N]

where N is a parameter.  Following the way you compute the difference
of the access functions, the fold works in one of the cases but fails
on the other:

fold (2*N - 2*N - 1) = -1
fold (2*N + 1 - 2*N) = 2*N + 1 - 2*N 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]