Common Subexpression Elimination

If the same subexpressions appear in more than one computation and the values do not change between computations, Visual Fortran computes the result once and replaces the subexpressions with the result itself:

  DIMENSION A(25,25), B(25,25)
  A(I,J) = B(I,J)

Without optimization, these statements can be coded as follows:

  t1 = ((J-1)*25+(I-1))*4
  t2 = ((J-1)*25+(I-1))*4
  A(t1) = B(t2)

Variables t1 and t2 represent equivalent expressions. Visual Fortran eliminates this redundancy by producing the following:

  t = ((J-1)*25+(I-1))*4
  A(t) = B(t)