[commit: ghc] master: Stop the specialiser generating loopy code (2b74bd9)

git at git.haskell.org git at git.haskell.org
Wed Jun 7 12:47:48 UTC 2017


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

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

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

commit 2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19
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.


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

2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19
 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 2b74bd9d8b4c6b20f3e8d9ada12e7db645cc3c19


More information about the ghc-commits mailing list