![]() | ![]() | ![]() | Global Common Sub-expression Elimination |
x = y*z; while ( z > 0 ) { if ( y*z > l ) { z = m/n } else { z = m/n - 1; } m = m/n }
Note, as I mentioned earlier, "global" in compiler-optmization really means one-procedure-at-a-time.
We begin by scanning the code of the procedure being processed to identify textually equivalent expressions. That is, we ignore whether the actual values of the expressions we identify might be different because they reference variables whose values have changed.
This is not sufficient to identify CSE's, but it serves as an important first step.
![]() | ![]() | ![]() | Global Common Sub-expression Elimination |