Skip to content

Eta reduction based on evaluation context (#21261)

Sebastian Graf requested to merge wip/T21261 into master

I completely rewrote our Notes surrounding eta-reduction. The new entry point is Note [Eta reduction makes sense].

Then I went on to extend the Simplifier to maintain an evaluation context in the form of a SubDemand inside a SimplCont. That SubDemand is useful for doing eta reduction according to Note [Eta reduction based on evaluation context], which describes how Demand analysis, Simplifier and tryEtaReduce interact to facilitate eta reduction in more scenarios.

Thus we fix #21261 (closed).

ghc/alloc perf marginally improves (-0.0%). A medium-sized win is when compiling T3064 (-3%). It seems that haddock improves by 0.6% to 1.0%, too.

There is no change on NoFib.

Edited by Sebastian Graf

Merge request reports