Common sub-expression elimination