On 4/10/07, Diego Novillo <[EMAIL PROTECTED]> wrote:
Ian Lance Taylor wrote on 04/10/07 13:53:
> I seem to recall that at one point somebody worked on a gensimplify
> program or something like that. Would it make sense to revive that
> approach, and use it to generate simplifiers for trees, GIMPLE, and
> RTL, to avoid triplification of these basic optimizations?
Perhaps. This would allow us to define folding/simplification using a
pattern matching system. I think I like this better than the other two
choices.
Yes, I worked on gensimplify, but i gave up when i realized it will
only work in the most trivial of cases for the case of RTL and trees,
because of how different modes and types are. (modes were very well
defined and simple, types are complex).
This may or may not be true of GIMPLE and tree.
That said, you are going to need to come up with a pretty complex
pattern matching language (that includes being able to, for example,
compare precision of types), or write a lot of the predicates
externally in order to represent a lot of the fold optimizations.
It may make adding future folding and simplification easier, but it's
going to be a pain in the ass to rework into a pattern matching style
:)