I'm 99% sure all major C-compilers (at least with optimizations turned on) will collect common subexpressions, however I can definitely add a check for base.is_symbol if you want that? (this whole PR is based on feedback in #7517 which covers my real world needs..)