[commit: ghc] master: Allow top-level string literals in Core (#8472) (d49b2bb)
git at git.haskell.org
git at git.haskell.org
Fri Jan 20 19:53:00 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d49b2bb21691892ca6ac8f2403e31f2a5e53feb3/ghc
>---------------------------------------------------------------
commit d49b2bb21691892ca6ac8f2403e31f2a5e53feb3
Author: Takano Akio <tak at anoak.io>
Date: Wed Jan 18 18:26:47 2017 -0500
Allow top-level string literals in Core (#8472)
This commits relaxes the invariants of the Core syntax so that a
top-level variable can be bound to a primitive string literal of type
Addr#.
This commit:
* Relaxes the invatiants of the Core, and allows top-level bindings whose
type is Addr# as long as their RHS is either a primitive string literal or
another variable.
* Allows the simplifier and the full-laziness transformer to float out
primitive string literals to the top leve.
* Introduces the new StgGenTopBinding type to accomodate top-level Addr#
bindings.
* Introduces a new type of labels in the object code, with the suffix "_bytes",
for exported top-level Addr# bindings.
* Makes some built-in rules more robust. This was necessary to keep them
functional after the above changes.
This is a continuation of D2554.
Rebasing notes:
This had two slightly suspicious performance regressions:
* T12425: bytes allocated regressed by roughly 5%
* T4029: bytes allocated regressed by a bit over 1%
* T13035: bytes allocated regressed by a bit over 5%
These deserve additional investigation.
Rebased by: bgamari.
Test Plan: ./validate --slow
Reviewers: goldfire, trofi, simonmar, simonpj, austin, hvr, bgamari
Reviewed By: trofi, simonpj, bgamari
Subscribers: trofi, simonpj, gridaphobe, thomie
Differential Revision: https://phabricator.haskell.org/D2605
GHC Trac Issues: #8472
>---------------------------------------------------------------
d49b2bb21691892ca6ac8f2403e31f2a5e53feb3
compiler/cmm/CLabel.hs | 13 ++++
compiler/cmm/CmmInfo.hs | 2 +-
compiler/cmm/CmmUtils.hs | 9 +--
compiler/codeGen/StgCmm.hs | 17 ++++-
compiler/codeGen/StgCmmClosure.hs | 5 ++
compiler/codeGen/StgCmmEnv.hs | 14 +++-
compiler/codeGen/StgCmmUtils.hs | 2 +-
compiler/coreSyn/CoreLint.hs | 22 +++++-
compiler/coreSyn/CorePrep.hs | 4 +-
compiler/coreSyn/CoreSubst.hs | 2 +-
compiler/coreSyn/CoreSyn.hs | 44 ++++++++++-
compiler/coreSyn/CoreUtils.hs | 12 +++
compiler/ghci/ByteCodeAsm.hs | 7 +-
compiler/ghci/ByteCodeGen.hs | 73 ++++++++++++++----
compiler/main/HscMain.hs | 4 +-
compiler/prelude/PrelRules.hs | 41 ++++++-----
compiler/profiling/SCCfinal.hs | 18 +++--
compiler/simplCore/CSE.hs | 57 ++++++++++----
compiler/simplCore/SetLevels.hs | 11 +--
compiler/simplCore/SimplEnv.hs | 6 +-
compiler/simplCore/Simplify.hs | 18 +++--
compiler/simplStg/SimplStg.hs | 12 +--
compiler/simplStg/StgCse.hs | 13 ++--
compiler/simplStg/StgStats.hs | 12 +--
compiler/simplStg/UnariseStg.hs | 9 ++-
compiler/stgSyn/CoreToStg.hs | 19 +++--
compiler/stgSyn/StgLint.hs | 17 +++--
compiler/stgSyn/StgSyn.hs | 67 ++++++++++++-----
docs/core-spec/core-spec.mng | 4 +-
.../tests/deSugar/should_compile/T2431.stderr | 44 ++++++++---
.../tests/numeric/should_compile/T7116.stdout | 30 ++++++--
testsuite/tests/perf/compiler/all.T | 17 +++--
testsuite/tests/perf/should_run/T8472.hs | 19 +++++
.../tests/perf/should_run/T8472.stdout | 0
testsuite/tests/perf/should_run/all.T | 8 ++
testsuite/tests/perf/space_leaks/all.T | 3 +-
.../tests/roles/should_compile/Roles13.stderr | 66 ++++++++++++-----
testsuite/tests/simplCore/should_compile/Makefile | 5 ++
.../tests/simplCore/should_compile/T3234.stderr | 9 ++-
.../tests/simplCore/should_compile/T3717.stderr | 30 ++++++--
.../tests/simplCore/should_compile/T3772.stdout | 30 ++++++--
.../tests/simplCore/should_compile/T4908.stderr | 30 ++++++--
.../tests/simplCore/should_compile/T4930.stderr | 30 ++++++--
.../tests/simplCore/should_compile/T7360.stderr | 86 +++++++++++++++++-----
.../tests/simplCore/should_compile/T8274.stdout | 18 +++--
.../tests/simplCore/should_compile/T9400.stderr | 22 ++++--
testsuite/tests/simplCore/should_compile/all.T | 4 +
.../simplCore/should_compile/noinline01.stderr | 32 ++++++--
.../tests/simplCore/should_compile/par01.stderr | 20 +++--
.../tests/simplCore/should_compile/rule2.stderr | 4 +-
.../simplCore/should_compile/spec-inline.stderr | 40 +++++++---
.../tests/simplCore/should_compile/str-rules.hs | 20 +++++
.../simplCore/should_compile/str-rules.stdout | 3 +
53 files changed, 829 insertions(+), 275 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 d49b2bb21691892ca6ac8f2403e31f2a5e53feb3
More information about the ghc-commits
mailing list