From a221b68c5a4d5cf7a02f14650e2fde4774174d12 Mon Sep 17 00:00:00 2001 From: Andreas Klebinger Date: Thu, 1 Apr 2021 19:19:51 +0200 Subject: Experiment: Add unfolings for class selectors. This should benefit the specialiser. --- compiler/GHC/Types/Id/Make.hs | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.1