Do forward and backward substitution to eliminate loads and stores when possible.