[commit: ghc] wip/D1242: Implement function-sections for Haskell code, #8405 (bb0897f)

git at git.haskell.org git at git.haskell.org
Sat Sep 19 14:26:07 UTC 2015


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

On branch  : wip/D1242
Link       : http://ghc.haskell.org/trac/ghc/changeset/bb0897f60abcce697a1038baba86923eb8baa971/ghc

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

commit bb0897f60abcce697a1038baba86923eb8baa971
Author: Simon Brenner <olsner at gmail.com>
Date:   Sat Sep 19 15:23:51 2015 +0200

    Implement function-sections for Haskell code, #8405
    
    Summary:
    This adds a flag -split-sections that does similar things to -split-objs, but
    using sections in single object files instead of relying on the Satanic
    Splitter and other abominations. This is very similar to the GCC flags
    -ffunction-sections and -fdata-sections.
    
    The --gc-sections linker flag, which allows unused sections to actually
    be removed, is added to all link commands (if the linker supports it) so that
    space savings from having base compiled with sections can be realized.
    
    Supported both in LLVM and the native code-gen, in theory for all
    architectures, but really tested on x86 only.
    
    In the GHC build, a new SplitSections variable enables -split-sections for
    relevant parts of the build.
    
    Test Plan: validate with both settings of SplitSections
    
    Reviewers: simonmar, austin, dterei, bgamari
    
    Subscribers: erikd, kgardas, thomie
    
    Differential Revision: https://phabricator.haskell.org/D1242
    
    GHC Trac Issues: #8405


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

bb0897f60abcce697a1038baba86923eb8baa971
 compiler/cmm/Cmm.hs                       |  11 ++-
 compiler/cmm/CmmBuildInfoTables.hs        |   6 +-
 compiler/cmm/CmmInfo.hs                   |   2 +-
 compiler/cmm/CmmParse.y                   |   4 +-
 compiler/cmm/CmmUtils.hs                  |   7 +-
 compiler/cmm/PprCmmDecl.hs                |  26 ++++---
 compiler/codeGen/StgCmm.hs                |   3 +-
 compiler/codeGen/StgCmmUtils.hs           |   2 +-
 compiler/ghc.mk                           |   3 +
 compiler/llvmGen/LlvmCodeGen/Base.hs      |   8 ++-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs   |   4 +-
 compiler/llvmGen/LlvmCodeGen/Data.hs      |  43 ++++++++---
 compiler/llvmGen/LlvmCodeGen/Ppr.hs       |   4 +-
 compiler/main/DriverPipeline.hs           |   4 ++
 compiler/main/DynFlags.hs                 |   8 ++-
 compiler/main/HscMain.hs                  |   2 +-
 compiler/main/SysTools.hs                 |   1 +
 compiler/nativeGen/AsmCodeGen.hs          |   7 +-
 compiler/nativeGen/Dwarf.hs               |  12 +++-
 compiler/nativeGen/Dwarf/Types.hs         |  23 +++---
 compiler/nativeGen/PPC/CodeGen.hs         |  11 ++-
 compiler/nativeGen/PPC/Ppr.hs             |  80 ++++++++++-----------
 compiler/nativeGen/PprBase.hs             |  51 ++++++++++++-
 compiler/nativeGen/SPARC/CodeGen.hs       |   4 +-
 compiler/nativeGen/SPARC/CodeGen/Gen32.hs |   4 +-
 compiler/nativeGen/SPARC/Ppr.hs           |  58 ++++++++-------
 compiler/nativeGen/X86/CodeGen.hs         |  61 ++++++++--------
 compiler/nativeGen/X86/Ppr.hs             | 114 ++++++++++++------------------
 docs/users_guide/flags.xml                |   6 ++
 docs/users_guide/phases.xml               |  19 +++++
 mk/config.mk.in                           |  11 +++
 rts/ghc.mk                                |   4 ++
 rules/build-package.mk                    |   9 +++
 rules/distdir-way-opts.mk                 |   1 +
 34 files changed, 381 insertions(+), 232 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 bb0897f60abcce697a1038baba86923eb8baa971


More information about the ghc-commits mailing list