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]

Re: List of simplifications we should perform


On 11-May-2001, Diego Novillo <dnovillo@redhat.com> wrote:
> 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 "" ""))))]
> >   "condition"
> >   [(set (match-dup 0) (match-dup 1))]
> >   "prep-statement"
> >   )
> 
> 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.

The drawback of that approach is that you'd then need an ML implementation
around in order to compile GCC.  Unfortunately GCC doesn't have an ML
front-end, so either someone would have to write an ML front-end for GCC,
or we'd have to use some other ML implementation.  If we use an ML
implementation that is not based on GCC, then porting GCC to a new
architecture would require also porting the ML implementation
(or cross-compiling).

<plug>
There is however another high-level functional language, quite similar
in many ways to ML, for which there is a GCC front-end...
</plug>

;-)

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


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