|common sub-expression elimination sastry@GODEL.MIEL.MOT.COM (1995-02-03)|
|Re: common sub-expression elimination email@example.com (1995-02-05)|
|Re: common sub-expression elimination firstname.lastname@example.org (1995-02-05)|
|From:||sastry@GODEL.MIEL.MOT.COM (Venkateshwara Sastry)|
|Keywords:||optimize, question, comment|
|Date:||Fri, 3 Feb 1995 12:14:47 GMT|
Consider the following code with common subexpression
With triple or DAG as IR and algorithms discribed in dragon book it is not
possible to identify the RHS of the above two expressions as a common
*Is there any IR (other than post-fix and pre-fix expression) with which
above transformation can be easily done.
* Are there any papers which deal with efficient way of performing such
optimizations for any kind of IR including post-fix and pre-fix notation.
[It is my impression that in situations like this where you want to take
advantage of associativity, ad hoc approaches work as well as any, e.g. when
building the DAG, make a list of all the things being added together in an
expression, sort the list, and work from there. It also helps collapse
constants, e.g. 1+n+2 => n+3. -John]
Return to the
Search the comp.compilers archives again.