[commit: ghc] ghc-8.2: Stop the specialiser generating loopy code (a7a1d7f)

git at git.haskell.org git at git.haskell.org
Thu Jun 15 03:03:48 UTC 2017


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

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

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

commit a7a1d7fdcd3e34787f28be4eb24645c2e14a9f3d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Jun 7 12:03:51 2017 +0100

    Stop the specialiser generating loopy code
    
    This patch fixes a bad bug in the specialiser, which showed up as
    Trac #13429.  When specialising an imported DFun, the specialiser could
    generate a recusive loop where none existed in the original program.
    
    It's all rather tricky, and I've documented it at some length in
       Note [Avoiding loops]
    
    We'd encoutered exactly this before (Trac #3591) but I had failed
    to realise that the very same thing could happen for /imported/
    DFuns.
    
    I did quite a bit of refactoring.
    
    The compiler seems to get a tiny bit faster on
       deriving/perf/T10858
    but almost all the gain had occurred before now; this
    patch just pushed it over the line.
    
    (cherry picked from commit 2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19)


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

a7a1d7fdcd3e34787f28be4eb24645c2e14a9f3d
 compiler/specialise/Specialise.hs                  | 413 ++++++++++++---------
 testsuite/tests/deriving/perf/all.T                |   4 +-
 testsuite/tests/simplCore/should_compile/T13429.hs | 114 ------
 testsuite/tests/simplCore/should_compile/all.T     |   1 -
 testsuite/tests/simplCore/should_run/T13429.hs     |  63 ++++
 .../tests/simplCore/should_run/T13429.stdout       |   0
 testsuite/tests/simplCore/should_run/T13429_2.hs   |  10 +
 .../tests/simplCore/should_run/T13429_2.stdout     |   1 +
 testsuite/tests/simplCore/should_run/T13429_2a.hs  |  37 ++
 testsuite/tests/simplCore/should_run/T13429a.hs    | 343 +++++++++++++++++
 testsuite/tests/simplCore/should_run/all.T         |   2 +
 11 files changed, 699 insertions(+), 289 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 a7a1d7fdcd3e34787f28be4eb24645c2e14a9f3d


More information about the ghc-commits mailing list