This is the mail archive of the
mailing list for the GCC project.
Re: List of simplifications we should perform
On Fri, 11 May 2001, DJ Delorie wrote:
> > One could even take this a step further and provide an interface
> > to allow people to write optimizer in higher-level languages. I'm
> > not sure how practical would that be, though.
> (define-optimization "neg-neg"
> [(set (match-operand:SI 0 "" "")
> (neg:SI (neg:SI (match-operand:SI 1 "" ""))))]
> [(set (match-dup 0) (match-dup 1))]
Yes, this is cool for localized peephole-like optimizations. And,
yes it would be a nice beginner's project.
But, can you describe GCSE with this? Or an SSA based PRE?
What would be really cool is to have a sufficiently high-level
language (say ML?) that lets you take an algorithm from a book
and just type it in virtually unmodified. Leaving all the gritty
bit-munching details to the optimizer generator.
Alternatively, you could adapt an dataflow generator like sharlit
or what have you.