head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	96.11.19.22.14.56;	author nathanw;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Notes on CSE.
@
text
@Notes on the common subexpression elimination optimization.

What is an expression?
  - binary operations
    - Only involve simple types and constants 

    Detecting the validity of these is pretty easy; we check to see if
    a variable has been assigned to. Function calls are irrelevant. 


  - array references
  - field references
	

    Detecting the validity of these is more difficult.  Ths state
    could be invalidated by assignment to any object that could be
    aliased to this one, so we'd need to check types instead of names
    for conservative analysis. Any function call kills these as well,
    for the same reasons.


Note that these are all forms of rhs in the IL. Thus, we need sets of
rhs for the avaliable expressions, as well as a comparison function
(deep equals). 

The language spec requires left-to-right evaluation, but since there
are no side effects outside of function calls and we don't eliminate
common function calls, we don't change any semantics if we reverse a+b
or a*b.
@
