diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2021-05-04 08:29:21 +0100 |
---|---|---|
committer | Simon Peyton Jones <simon.peytonjones@gmail.com> | 2022-01-26 09:33:19 +0000 |
commit | 9041cd4588ccd2e9304e2751845474c8f4b4d0d9 (patch) | |
tree | 79f50f16a5f885acb794e318a39221c179e293aa /compiler/GHC/Core/Opt/Pipeline.hs | |
parent | 781323a3076781b5db50bdbeb8f64394add43836 (diff) | |
download | haskell-wip/T19790a.tar.gz |
Make RULE matching insensitive to eta-expansionwip/T19790a
This patch fixes #19790 by making the rule matcher do on-the-fly
eta reduction. See Note [Eta reduction the target] in GHC.Core.Rules
I found I also had to careful about casts when matching; see
Note [Casts in the target] and Note [Casts in the template]
Lots more comments and Notes in the rule matcher
Diffstat (limited to 'compiler/GHC/Core/Opt/Pipeline.hs')
-rw-r--r-- | compiler/GHC/Core/Opt/Pipeline.hs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/compiler/GHC/Core/Opt/Pipeline.hs b/compiler/GHC/Core/Opt/Pipeline.hs index 8b1106904f..f6511439ac 100644 --- a/compiler/GHC/Core/Opt/Pipeline.hs +++ b/compiler/GHC/Core/Opt/Pipeline.hs @@ -162,16 +162,17 @@ getCoreToDo logger dflags maybe_strictness_before _ = CoreDoNothing - base_mode = SimplMode { sm_phase = panic "base_mode" - , sm_names = [] - , sm_dflags = dflags - , sm_logger = logger - , sm_uf_opts = unfoldingOpts dflags - , sm_rules = rules_on - , sm_eta_expand = eta_expand_on - , sm_inline = True - , sm_case_case = True - , sm_pre_inline = pre_inline_on + base_mode = SimplMode { sm_phase = panic "base_mode" + , sm_names = [] + , sm_dflags = dflags + , sm_logger = logger + , sm_uf_opts = unfoldingOpts dflags + , sm_rules = rules_on + , sm_eta_expand = eta_expand_on + , sm_cast_swizzle = True + , sm_inline = True + , sm_case_case = True + , sm_pre_inline = pre_inline_on } simpl_phase phase name iter |