diff options
author | Takano Akio <tak@anoak.io> | 2017-01-18 18:26:47 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-01-20 14:36:29 -0500 |
commit | d49b2bb21691892ca6ac8f2403e31f2a5e53feb3 (patch) | |
tree | cc8488acf59467899e4d3279a340577eec95310f /testsuite/tests/numeric | |
parent | a2a67b77c3048713541d1ed96ec0b95fb2542f9a (diff) | |
download | haskell-d49b2bb21691892ca6ac8f2403e31f2a5e53feb3.tar.gz |
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
Diffstat (limited to 'testsuite/tests/numeric')
-rw-r--r-- | testsuite/tests/numeric/should_compile/T7116.stdout | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/testsuite/tests/numeric/should_compile/T7116.stdout b/testsuite/tests/numeric/should_compile/T7116.stdout index 9f7837bdc7..7fe4d93d87 100644 --- a/testsuite/tests/numeric/should_compile/T7116.stdout +++ b/testsuite/tests/numeric/should_compile/T7116.stdout @@ -1,15 +1,31 @@ ==================== Tidy Core ==================== -Result size of Tidy Core = {terms: 46, types: 23, coercions: 0} +Result size of Tidy Core = {terms: 50, types: 25, coercions: 0} + +-- RHS size: {terms: 1, types: 0, coercions: 0} +T7116.$trModule4 :: GHC.Prim.Addr# +[GblId, + Caf=NoCafRefs, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 20 0}] +T7116.$trModule4 = "main"# -- RHS size: {terms: 2, types: 0, coercions: 0} -T7116.$trModule2 :: GHC.Types.TrName +T7116.$trModule3 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 20}] -T7116.$trModule2 = GHC.Types.TrNameS "main"# + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] +T7116.$trModule3 = GHC.Types.TrNameS T7116.$trModule4 + +-- RHS size: {terms: 1, types: 0, coercions: 0} +T7116.$trModule2 :: GHC.Prim.Addr# +[GblId, + Caf=NoCafRefs, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 30 0}] +T7116.$trModule2 = "T7116"# -- RHS size: {terms: 2, types: 0, coercions: 0} T7116.$trModule1 :: GHC.Types.TrName @@ -17,8 +33,8 @@ T7116.$trModule1 :: GHC.Types.TrName Caf=NoCafRefs, Str=m1, Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 40 20}] -T7116.$trModule1 = GHC.Types.TrNameS "T7116"# + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] +T7116.$trModule1 = GHC.Types.TrNameS T7116.$trModule2 -- RHS size: {terms: 3, types: 0, coercions: 0} T7116.$trModule :: GHC.Types.Module @@ -28,7 +44,7 @@ T7116.$trModule :: GHC.Types.Module Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 30}] T7116.$trModule = - GHC.Types.Module T7116.$trModule2 T7116.$trModule1 + GHC.Types.Module T7116.$trModule3 T7116.$trModule1 -- RHS size: {terms: 8, types: 3, coercions: 0} dr :: Double -> Double |