[commit: ghc] master: Implement function-sections for Haskell code, #8405 (4a32bf9)
git at git.haskell.org
git at git.haskell.org
Thu Nov 12 14:54:47 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4a32bf925b8aba7885d9c745769fe84a10979a53/ghc
>---------------------------------------------------------------
commit 4a32bf925b8aba7885d9c745769fe84a10979a53
Author: Simon Brenner <olsner at gmail.com>
Date: Thu Nov 12 11:10:54 2015 +0100
Implement function-sections for Haskell code, #8405
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: dterei, Phyx, austin, simonmar, thomie, bgamari
Reviewed By: simonmar, thomie, bgamari
Subscribers: hsyl20, erikd, kgardas, thomie
Differential Revision: https://phabricator.haskell.org/D1242
GHC Trac Issues: #8405
>---------------------------------------------------------------
4a32bf925b8aba7885d9c745769fe84a10979a53
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 | 42 ++++++++---
compiler/llvmGen/LlvmCodeGen/Ppr.hs | 4 +-
compiler/main/DriverPipeline.hs | 4 ++
compiler/main/DynFlags.hs | 15 +++-
compiler/main/HscMain.hs | 2 +-
compiler/main/SysTools.hs | 1 +
compiler/nativeGen/AsmCodeGen.hs | 8 ++-
compiler/nativeGen/Dwarf.hs | 15 +++-
compiler/nativeGen/Dwarf/Types.hs | 23 ++++---
compiler/nativeGen/PPC/CodeGen.hs | 11 ++-
compiler/nativeGen/PPC/Ppr.hs | 94 +++++++++++--------------
compiler/nativeGen/PprBase.hs | 52 +++++++++++++-
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 | 111 +++++++++++-------------------
docs/users_guide/phases.rst | 14 ++++
driver/utils/merge_sections.ld | 26 +++++++
mk/config.mk.in | 11 +++
rts/ghc.mk | 4 ++
rules/build-package-way.mk | 6 +-
rules/build-package.mk | 9 +++
rules/distdir-way-opts.mk | 1 +
utils/mkUserGuidePart/Options/Linking.hs | 4 ++
36 files changed, 413 insertions(+), 247 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 4a32bf925b8aba7885d9c745769fe84a10979a53
More information about the ghc-commits
mailing list