Implement equals and hashCode for expressions.
Hash codes for complex expressions are cached into a field of the expression.
Use HashMap for searching of declarations to reuse, consider both optimizing && optimize flags when reusing