[commit: ghc] ghc-8.2: Fix loss-of-SpecConstr bug (7850538)

git at git.haskell.org git at git.haskell.org
Tue May 2 13:41:13 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/78505384d5e4c44e525dda7aa5a9ca7ff9e3ca22/ghc

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

commit 78505384d5e4c44e525dda7aa5a9ca7ff9e3ca22
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Tue May 2 12:04:44 2017 +0100

    Fix loss-of-SpecConstr bug
    
    This bug, reported in Trac #13623 has been present since
    
      commit b8b3e30a6eedf9f213b8a718573c4827cfa230ba
      Author: Edward Z. Yang <ezyang at cs.stanford.edu>
      Date:   Fri Jun 24 11:03:47 2016 -0700
    
          Axe RecFlag on TyCons.
    
    SpecConstr tries not to specialise indefinitely, and had a
    limit (see Note [Limit recursive specialisation]) that made
    use of info about whether or not a data constructor was
    "recursive".  This info vanished in the above commit, making
    the limit fire much more often -- and indeed it fired in this
    test case, in a situation where specialisation is /highly/
    desirable.
    
    I refactored the test, to look instead at the number of
    iterations of the loop of "and now specialise calls that
    arise from the specialisation".  Actually less code, and
    more robust.
    
    I also added record field names to a couple of constructors,
    and renamed RuleInfo to SpecInfo.
    
    (cherry picked from commit 9e47dc451788cce20acb6a8208c56a7e4dbe246b)


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

78505384d5e4c44e525dda7aa5a9ca7ff9e3ca22
 compiler/specialise/SpecConstr.hs             | 193 ++++++++++++++------------
 testsuite/tests/perf/should_run/T13623.hs     |  82 +++++++++++
 testsuite/tests/perf/should_run/T13623.stdout |   1 +
 testsuite/tests/perf/should_run/all.T         |   8 ++
 4 files changed, 198 insertions(+), 86 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 78505384d5e4c44e525dda7aa5a9ca7ff9e3ca22


More information about the ghc-commits mailing list