perf: ensure `Expr.replaceExpr` preserve DAG structure in `Expr`s (#4779)

2 files changed