Btw I’ve been using this in production for several months. It works.
This approach doesn’t use a CSE pass – it keeps UGens in a cache according to UGen class, rate and arguments. Only pure math ops are cached in that version but it could be extended to other pure UGens.