Skip to content

Draft: Make exprIsHNF more rigorous

Jaro Reinders requested to merge wip/no-let-hnf into master

As noted in !10841 (comment 517108), exprIsHNF needs some changes if we want to depend on it identifying expressions that need no further computation whatsoever. There is also a bug as noted in #23770.

Currently, the nofib results of this change are summarised as:

        Program           Size    Allocs   Runtime   Elapsed  TotalMem
            Min          -0.0%     -3.0%     -8.8%     -8.8%      0.0%
            Max          +0.4%     +0.6%    +10.4%    +10.4%      0.0%
 Geometric Mean          +0.0%     -0.0%     +0.2%     +0.2%     -0.0%

Full results: https://gitlab.haskell.org/ghc/ghc/uploads/5010945b8913afb9eeb1da6c23b2cd10/nofib-results.txt

So, on average it is not a very impactful change, but there are some significant regressions (and improvements!) on individual tests.

Merge request reports