summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Klebinger <klebinger.andreas@gmx.at>2021-04-01 19:19:51 +0200
committerAndreas Klebinger <klebinger.andreas@gmx.at>2021-04-01 19:19:51 +0200
commita221b68c5a4d5cf7a02f14650e2fde4774174d12 (patch)
tree480f6b3c34cd9689d083e88ab41fcd5e25be7b4b
parent6604409594f71d2ed5963bb3897bc4ee772cc5c0 (diff)
downloadhaskell-wip/andreask/dsel_unfold.tar.gz
Experiment: Add unfolings for class selectors.wip/andreask/dsel_unfold
This should benefit the specialiser.
-rw-r--r--compiler/GHC/Types/Id/Make.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/GHC/Types/Id/Make.hs b/compiler/GHC/Types/Id/Make.hs
index b2f9dc7adf..6b8da3609a 100644
--- a/compiler/GHC/Types/Id/Make.hs
+++ b/compiler/GHC/Types/Id/Make.hs
@@ -498,6 +498,10 @@ mkDictSelId name clas
| otherwise
= base_info `setRuleInfo` mkRuleInfo [rule]
+ `setInlinePragInfo` neverInlinePragma
+ `setUnfoldingInfo` mkInlineUnfoldingWithArity 1
+ defaultSimpleOpts
+ (mkDictSelRhs clas val_index)
-- Add a magic BuiltinRule, but no unfolding
-- so that the rule is always available to fire.
-- See Note [ClassOp/DFun selection] in GHC.Tc.TyCl.Instance