Note [SpecConstr and strict fields]
We treat strict fields in SpecConstr the same way we do in W/W. That is we make the specialized function strict in arguments representing strict fields. See Note [Call-by-value for worker args] for why we do this. (SCF1) The arg_id might be an /imported/ Id like M.foo_acf (see #24944). We don't want to make case M.foo_acf of M.foo_acf { DEFAULT -> blah } because the binder of a case-expression should never be imported. Rather, we must localise it thus: case M.foo_acf of foo_acf { DEFAULT -> blah } We keep the same unique, so in the next round of simplification we'll replace any M.foo_acf's in `blah` by `foo_acf`. c.f. Note [Localise pattern binders] in GHC.HsToCore.Utils.
References 2
- Call-by-value for worker args GHC.Core.Utils
- Localise pattern binders GHC.HsToCore.Utils
Referenced by 6
- GHC.Core.Opt.SpecConstr call site ×6