This is the mail archive of the gcc@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] Use of build_binary_op


Op do 26-09-2002, om 10:40 schreef Pop Sébastian:
> 
> G95 uses is_simple_* functions.  That means that for building valid trees 
> they have to keep track of the lowering stuff as well, when they would
> just need a generic tree interface.

Well, we mostly use them for debugging purposes, just to make sure that
our tree is a valid SIMPLE tree. Only four or five of them are really
necessary.

> I think that we have to define an interface on both lowered and 
> non lowered GIMPLE.  Then we'd have:
> - a build_* interface for front-end specific trees,
> - a generic_build_* interface for building non lowered GIMPLE trees,
> - a simple_build_* interface for transformations on lowered trees,
> - an expand_* interface for translating GIMPLE to RTL,
> (and get rid of genrtl_* interface that works on statements).

If the C-family front ends need a translation from C trees to GIMPLE,
then why can't lowering of expressions be done on GIMPLE stmt trees.
That way, the front ends can share the expression simplification
interface, and they would only have to deal with side effects in
language specific trees.

So we'd have:
- a build_* interface for building generic trees
  (goes/stays in tree.*)
- a build_<lang>_* interface for language specific trees
  (goes/stays in <lang>-tree.* and c-common.*).
- a build_gimple_* interface for building GIMPLE stmt trees, that is,
  expressions are *not* lowered here.
- a gimple_expand_* interface for lowering expressions in GIMPLE trees.
- a gimple_expand_body() to optimize a function body and expand to RTL.

This is more like what we do now with RTL: build and expand stuff
piecewise. It would allow front ends to optimize the pieces of GIMPLE
tree, e.g. kill breaks/goto's from loops only. Right now all the
optimizers work on whole function trees only, even if they don't need
SSA form.

Some lowering of language specifics would obviously have to be done
while building GIMPLE stmt trees, so we'd need a formal grammar for
expressions. The build_gimple_* interface could make sure (perhaps only
with checking enabled) that any expressions it sees are valid non-simple
exprs that can be lowered by the gimple_expand_* interface.

Greetz
Steven



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