[commit: ghc] wip/spj-float-in: Kill off complications in CoreFVs (cf8ac3e)

git at git.haskell.org git at git.haskell.org
Mon Apr 10 16:38:23 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/spj-float-in
Link       : http://ghc.haskell.org/trac/ghc/changeset/cf8ac3ea2b3c53a1b40f1b25914d98ed1a8446f6/ghc

>---------------------------------------------------------------

commit cf8ac3ea2b3c53a1b40f1b25914d98ed1a8446f6
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Apr 7 17:10:07 2017 +0100

    Kill off complications in CoreFVs
    
    When doing type-in-type, Richard introduce some substantial
    complications in CoreFVs, gathering types and free variables
    of type.  In Trac #13160 we decided that this complication was
    unnecessary, so this patch removes it.
    
    Unfortnately I then fell down a twisty rabbit hole.  Roughly:
    
    * An apparently-innocuous change in the AnnApp case of
      fiExpr made the fuction a little bit stricter, so we ended
      up peering into the arguments when we didn't before (namely
      when there are no bindings being floated inwards).  I've
      rejigged it so that it's not fragile any more.
    
    * Peering into the arguments was sometimes expensive, becuase
      exprIsExpandable can be expensive because it looks deeply into
      the expression.
    
    * The combination of the two led to an combinatorial explosion
      of work when the argument of a function is a deeep nest
      of constructors.  This bug has been lurking for ages.
    
      I solved it by replacing exprIsExpandable with exprIsHNF,
      which does a good enough job for the purpose here.
    
    Working all this out meant that I rewrote quite a bit of
    code, so it's now a reasonably substantial patch.  But it's
    a net improvement.


>---------------------------------------------------------------

cf8ac3ea2b3c53a1b40f1b25914d98ed1a8446f6
 compiler/coreSyn/CoreFVs.hs   | 105 +++++--------------
 compiler/simplCore/FloatIn.hs | 235 ++++++++++++++++++++++++------------------
 2 files changed, 158 insertions(+), 182 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc cf8ac3ea2b3c53a1b40f1b25914d98ed1a8446f6


More information about the ghc-commits mailing list