Add caching of constant expressions.