[commit: ghc] master: Set strictness correctly for JoinIds (ce6ce78)

git at git.haskell.org git at git.haskell.org
Tue Aug 21 16:12:15 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ce6ce788251b6102f5c1b878ffec53ba7ad678b5/ghc

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

commit ce6ce788251b6102f5c1b878ffec53ba7ad678b5
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


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

ce6ce788251b6102f5c1b878ffec53ba7ad678b5
 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 ce6ce788251b6102f5c1b878ffec53ba7ad678b5


More information about the ghc-commits mailing list