Common subexpression elimination