Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!snorkelwacker!spdcc!esegue!compilers-sender From: grover@brahmand.Eng.Sun.COM (Vinod Grover) Newsgroups: comp.compilers Subject: Re: Intermediate Representation Keywords: code, optimize, design Message-ID: <1990Aug09.180627.18848@esegue.segue.boston.ma.us> Date: 9 Aug 90 18:06:27 GMT References: <1990Aug08.171640.13892@esegue.segue.boston.ma.us> Sender: compilers-sender@esegue.segue.boston.ma.us Reply-To: grover@brahmand.Eng.Sun.COM (Vinod Grover) Organization: Sun Microsystems, Mt. View, Ca. Lines: 30 Approved: compilers@esegue.segue.boston.ma.us In article <1990Aug08.171640.13892@esegue.segue.boston.ma.us> Preston Briggs writes: >AST's seem too high-level for doing lots of optimization. We want the >details of array accesses, etc. exposed to the optimizer. > >Actually, I'll qualify this a little. I believe there are many optimizations >that can be carried out most effectively on a high-level representation (for >example, those requiring dependence analysis) and many that should be carried >out on a low level representation (e.g., CSE elimination, strength >reduction). This is the sort of approach we've taken locally. First of all, there is no reason why an AST based IR cannot have low-level features (such as array/memory accesses). The Bliss-11 compiler had the '.' (dot) operator for representing memory fetches. One nice feature property of the dot operator was that it could be used, both, in lhs and rhs position of an assignment operator. e.g. a[i] would be represented as .(a+.i) This made a lot of optimizations quite simple and uniform. e.g a memory access could be treated as a CSE. Second, as Bliss-11 showed global CSE elimination can be done at a high level. Similarly, strength reduction isnt that hard at a high level. Karl Ottenstein showed, in an IEEE paper several years ago, that strength reduction is easy to do on PDGs and can easily be extended to ASTs. (I do not have the reference handy but can post it, if anyone is interested.) Vinod Grover Sun Microsystems grover@sun.com -- Send compilers articles to compilers@esegue.segue.boston.ma.us {spdcc | ima | lotus| world}!esegue. Meta-mail to compilers-request@esegue.