[commit: ghc] master: Make sure forM_ and related functions fuse cleanly (e655aac)

git at git.haskell.org git at git.haskell.org
Mon Sep 17 20:25:47 UTC 2018


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

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

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

commit e655aac18c5b240f27fcaf26317ad87be5ce8b96
Author: Sebastian Graf <sebastian.graf at kit.edu>
Date:   Mon Sep 17 21:11:09 2018 +0200

    Make sure forM_ and related functions fuse cleanly
    
    Summary:
    It was revealed in #8763 that it's hard to come up with a list fusion
    helper for `efdtIntFB` that doesn't duplicated occurrences of `c`,
    which is crucial in guaranteeing that it is inlined.
    
    Not inlining `c` led to spoiled join points, in turn leading to unnecessary
    heap allocation. This patch tackles the problem from a different angle:
    Fixing all consumers instead of the less often used producer
    `efdtIntFB` by inserting an INLINE pragma in the appropriate places.
    See https://ghc.haskell.org/trac/ghc/ticket/8763#comment:76 and the new
    Note [List fusion and continuations in 'c'].
    
    A quick run of NoFib revealed no regression or improvements whatsoever.
    
    Reviewers: hvr, bgamari, simonpj
    
    Reviewed By: simonpj
    
    Subscribers: simonpj, rwbarton, carter
    
    GHC Trac Issues: #8763
    
    Differential Revision: https://phabricator.haskell.org/D5131


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

e655aac18c5b240f27fcaf26317ad87be5ce8b96
 libraries/base/Data/Foldable.hs            | 110 ++++++++++++++++++++++++++---
 testsuite/tests/perf/compiler/T4007.stdout |   4 +-
 testsuite/tests/perf/should_run/T8763.hs   |  41 +++++++++++
 testsuite/tests/perf/should_run/all.T      |   7 ++
 4 files changed, 153 insertions(+), 9 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 e655aac18c5b240f27fcaf26317ad87be5ce8b96


More information about the ghc-commits mailing list