cardinal-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Cardinal-dev] Compiler structure / AST format


From: Dan Sugalski
Subject: Re: [Cardinal-dev] Compiler structure / AST format
Date: Wed, 1 May 2002 15:07:44 -0400

At 8:14 AM +0300 4/26/02, Einar Karttunen wrote:
On 25.04 11:53, Dan Sugalski wrote:
 At 4:05 AM +0300 4/25/02, Einar Karttunen wrote:
 >The reason for the immediate is the optimiser pass and the
 >complexity of backends.
 >* backends need to only know about the intermediate code not the AST
 >* frontends and backends can be switched with no recoding
 >* some optimisations common to all backends are very unnatural at
 >the AST level

 I'll point out that some optimisations common to all backends are
 very natural to do at the AST level. Most compilers I know of have at
 least three different intermediate representations of the code for
 the optimiser because of the different characteristics of the
 different optimisations. Some work best with a high-level
 representation, some with a medium-level representation, and some
 with a low-level representation.

Of course some optimisation is best done in AST level, and I think
my message made it clear. Most compilers I know about have just
two level if you don't count instruction scheduling as a third
level.

It's worth counting instruction scheduling. (As I reply really tardily) It can make a significant difference, even more so when the instructions are as heavy-weight as you'll find in an interpreter. Still, they matter on hardware as well.

I wouldn't be surprised to see some cases where proper instruction scheduling on parrot, assuming the source languge will allow it, brings a win of 10-30% in execution time. Not hugely common, mind, but a definite possibility. (The smaller the L1 and L2 caches on a processor the more instruction scheduling will get you a performance win)
--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
address@hidden                         have teddy bears and even
                                      teddy bears get drunk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]