Skip to content

IR DCE performs a no-op rewrite on every Abs with ParamUnused #145

Description

@Unisay

In dceAnnotatedExp (lib/Language/PureScript/Backend/IR/DCE.hs), the Abs case guards on not (paramId member reachableIds). A ParamUnused binder's id is never referenced, so the guard is true for every unused-parameter lambda and the rewrite fires, producing a Rewritten Recurse with an identical expression (the ParamUnused branch maps the parameter to itself and leaves the body alone).

Harmless but wasteful noise on every traversal. The guard should require ParamNamed, leaving ParamUnused lambdas untouched (NoChange).

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