[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [DotGNU]gcc?
From: |
Rhys Weatherley |
Subject: |
Re: [DotGNU]gcc? |
Date: |
Mon, 05 Nov 2001 16:08:41 +1000 |
Fergus Henderson wrote:
> > Is there a particular IL optimization that Mercury would
> > benefit from?
>
> There's a few that might help: [...]
Most of these are more sophisticated than the assembler
can deal with. They need knowledge of the program's
parse tree or post-parse intermediate representation.
A separate optimization tool that rebuilds the tree and
optimises that would be a better approach. Fortunately,
there's quite a bit of code hanging around should someone
want to tackle this.
The bytecode verifier walks the code, verifies it, and
then calls API methods on a "coder" object. The current
coder object generates CVM bytecode, but it should be
possible to write a tree building coder instead.
> - Elimination of branches around branches.
> We sometimes generate code such as this:
> br label2
> label1:
> label2:
> The `br label2' instruction can be optimized away.
>
> - Jump threading (elimination of branches to branches).
These may be possible in the assembler. The first is
really a variant of jump threading, where a jump to the
next instruction is replaced with nothing.
> Now, that said, I don't think any of this is a high priority right now.
> Obviously getting all it working first is much more important than
> worrying about optimizations.
Yep. However, if some other brave soul wants to take
this on, they can start with the stand-alone verifier
"ilverify", and move forward from there.
Cheers,
Rhys.