[commit: ghc] ghc-8.6: Set strictness correctly for JoinIds (b81fc82)

git at git.haskell.org git at git.haskell.org
Tue Aug 21 22:57:12 UTC 2018


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

On branch  : ghc-8.6
Link       : http://ghc.haskell.org/trac/ghc/changeset/b81fc821597cb7578f93cbea772304f1effd46cf/ghc

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

commit b81fc821597cb7578f93cbea772304f1effd46cf
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue Aug 21 09:56:39 2018 +0100

    Set strictness correctly for JoinIds
    
    We were failing to keep correct strictness info when eta-expanding
    join points; Trac #15517.   The situation was something like
    
      \q v eta ->
         let j x = error "blah
             -- STR Lx   bottoming!
         in case y of
               A -> j x eta
               B -> blah
               C -> j x eta
    
    So we spot j as a join point and eta-expand it.  But we must
    also adjust the stricness info, else it vlaimes to bottom after
    one arg is applied but now it has become two.
    
    I fixed this in two places:
    
     - In CoreOpt.joinPointBinding_maybe, adjust strictness info
    
     - In SimplUtils.tryEtaExpandRhs, return consistent values
       for arity and bottom-ness
    
    (cherry picked from commit ce6ce788251b6102f5c1b878ffec53ba7ad678b5)


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

b81fc821597cb7578f93cbea772304f1effd46cf
 compiler/basicTypes/Demand.hs                      | 21 ++++-
 compiler/coreSyn/CoreOpt.hs                        | 28 ++++++-
 compiler/simplCore/SimplUtils.hs                   |  9 +-
 testsuite/tests/simplCore/should_compile/T15517.hs | 10 +++
 .../tests/simplCore/should_compile/T15517a.hs      | 96 ++++++++++++++++++++++
 testsuite/tests/simplCore/should_compile/all.T     |  4 +-
 6 files changed, 160 insertions(+), 8 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 b81fc821597cb7578f93cbea772304f1effd46cf


More information about the ghc-commits mailing list