Skip to content

CprAnal: Activate Sum CPR for local bindings

Sebastian Graf requested to merge wip/T5075 into master

We've had Sum CPR (#5075 (closed)) for top-level bindings for a couple of years now. That begs the question why we didn't also activate it for local bindings, and the reasons for that are described in Note [CPR for sum types]. Only that it didn't make sense! The Note said that Sum CPR would destroy let-no-escapes, but that should be a non-issue since we have syntactic join points in Core now and we don't WW for them (Note [Don't w/w join points for CPR]).

So I simply activated CPR for all bindings of sum type, thus fixing #5075 (closed) and #16570. NoFib approves:

--------------------------------------------------------------------------------
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
  comp_lab_zift          -0.0%     +0.7%
          fluid          +1.7%     +0.7%
        reptile          +0.1%     +0.1%
--------------------------------------------------------------------------------
            Min          -0.0%     -0.2%
            Max          +1.7%     +0.7%
 Geometric Mean          +0.0%     +0.0%
Edited by Sebastian Graf

Merge request reports