Skip to content

Draft: Simplifier: Fix `conSize` estimate (#22317)

Sebastian Graf requested to merge wip/T22317 into master

We now size up constructor applications like we do function applications. See the changes to Note [Constructor size and result discount].

I also changed Note [Inlining small things to avoid creating a thunk] so that it is clear that "thing" includes join points.

NoFib results:

--------------------------------------------------------------------------------
        Program         Allocs    Instrs
--------------------------------------------------------------------------------
           atom          +0.0%     -2.3%
      cacheprof          -0.0%     -3.0%
       calendar          +1.1%     +1.1%
       cichelli           0.0%     -0.5%
  comp_lab_zift          +0.8%     +0.5%
         dom-lt          +0.6%     +0.4%
          fasta          +0.0%     -0.4%
       fibheaps          -1.3%     -1.8%
         gamteb          -2.4%     -1.4%
         hidden          +0.0%     -0.9%
     last-piece          -1.5%     -2.4%
           life          +2.1%     +1.0%
         linear           0.0%     -1.8%
           para          -2.8%     -1.7%
            pic           0.0%     -0.6%
          solid          -4.0%     -1.2%
         sphere           0.0%     -1.0%
      transform          +0.0%     -0.8%
      wave4main          +0.8%     +0.2%
--------------------------------------------------------------------------------
            Min          -4.0%     -3.0%
            Max          +2.1%     +1.1%
 Geometric Mean          -0.1%     -0.2%

Binary sizes go down by 0.1%, ever so slightly.

Fixes #22317. Regression test in T22317b.

Edited by Sebastian Graf

Merge request reports