Skip to content

idempotently detects the fixpoint by deep Eq on the whole UberModule #144

Description

@Unisay

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: irIR / optimizer / DCE / inlinerenhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions