Implement Nested CPR
This ticket tracks the design and implementation of a Nested CPR, e.g. extending CPR analysis to unbox constructed products nested inside constructed products.
A list of tickets for motivation:
- CPR
IO
/State
computations #1600 (closed) - Various places in GHC/base where we currently unbox IO manually, like GHC.Utils.Encoding or
UniqSM
- A simple rapid-termination analysis (higher-order
exprIsCheap
/exprOkForSpeculation
) #8655 - Effective sum CPR needs to be nested and hence the terminaion analysis machinery
- Many heuristics of our current CPR analysis (i.e.
Note [CPR for binders that will be unboxed]
) are an artifact of not being able to express and propagate nested CPRs in case scrutinees to field binders.
Edited by Sebastian Graf