idempotently (lib/Language/PureScript/Backend/IR/Optimizer.hs) iterates eliminateDeadCode . optimizeModule to a fixpoint by comparing the whole UberModule with structural Eq after each round. Every iteration therefore pays a full structural comparison plus a complete DCE re-run (fresh ID assignment and graph rebuild for the entire module), even when a round changed nothing or almost nothing.
Fix direction: have the rewrites report whether they changed anything (an Any-style writer or a change flag threaded through the pass runner) and stop on "no changes" instead of deep equality. The fixpoint combinator planned for the first-class pass pipeline (#138) is the natural home; this issue tracks actually switching the semantics from Eq to change-reporting once #138 lands.
Found during the 2026-07-02 backend audit.
idempotently(lib/Language/PureScript/Backend/IR/Optimizer.hs) iterateseliminateDeadCode . optimizeModuleto a fixpoint by comparing the wholeUberModulewith structuralEqafter each round. Every iteration therefore pays a full structural comparison plus a complete DCE re-run (fresh ID assignment and graph rebuild for the entire module), even when a round changed nothing or almost nothing.Fix direction: have the rewrites report whether they changed anything (an
Any-style writer or a change flag threaded through the pass runner) and stop on "no changes" instead of deep equality. The fixpoint combinator planned for the first-class pass pipeline (#138) is the natural home; this issue tracks actually switching the semantics fromEqto change-reporting once #138 lands.Found during the 2026-07-02 backend audit.