diff options
author | Joachim Breitner <mail@joachim-breitner.de> | 2015-04-17 16:00:50 +0200 |
---|---|---|
committer | Joachim Breitner <mail@joachim-breitner.de> | 2015-04-17 16:00:50 +0200 |
commit | ea40430343ee07e1bdc6ee948d7a27aa65dbf936 (patch) | |
tree | 66ca7bcbc9e44a0e6c7dd3b2a9f3f5ec0ba3724f /compiler/simplCore/SimplCore.hs | |
parent | 619a324ed6a35708e4a3746f48c23b4f294e82df (diff) | |
download | haskell-wip/T9020.tar.gz |
Do not eta-expand in SimplGentlwip/T9020
Eta-expansion can seriously blow up the size of the code, if there are
newtypes and coercions involved; see #9020 for a particularly good
example.
It may work out well in a full simplifier phase, when the additional
coercions can be optimized away, e.g. after inlining. But the gentle
phase does less, in particular no inlining, so chances are high that we
will blow up our code for on good reason.
If this change works out, there is no need for #10319 anymore.
Diffstat (limited to 'compiler/simplCore/SimplCore.hs')
-rw-r--r-- | compiler/simplCore/SimplCore.hs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/compiler/simplCore/SimplCore.hs b/compiler/simplCore/SimplCore.hs index 0fd929a2a6..38ba186e8a 100644 --- a/compiler/simplCore/SimplCore.hs +++ b/compiler/simplCore/SimplCore.hs @@ -179,9 +179,11 @@ getCoreToDo dflags , sm_names = ["Gentle"] , sm_rules = rules_on -- Note [RULEs enabled in SimplGently] , sm_inline = False - , sm_case_case = False }) - -- Don't do case-of-case transformations. - -- This makes full laziness work better + , sm_case_case = False + -- Don't do case-of-case transformations. + -- This makes full laziness work better + , sm_eta_expand = False}) + -- Note [Do not eta-expand in SimplGently] -- New demand analyser demand_analyser = (CoreDoPasses ([ @@ -946,3 +948,14 @@ transferIdInfo exported_id local_id (specInfo local_info) -- Remember to set the function-name field of the -- rules as we transfer them from one function to another + +-- Note [Do not eta-expand in SimplGently] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- +-- Eta-expansion can seriously blow up the size of the code, if there are +-- newtypes and coercions involved; see #9020 for a particularly good example. +-- +-- It may work out well in a full simplifier phase, when the additional +-- coercions can be optimized away, e.g. after inlining. But the gentle phase +-- does less, in particular no inlining, so chances are high that we will blow +-- up our code for on good reason. |