Note [Tick annotations in RULE matching]
We used to unconditionally look through ticks in both template and expression being matched. This is actually illegal for counting or cost-centre-scoped ticks, because we have no place to put them without changing entry counts and/or costs. So now we just fail the match in these cases. On the other hand, where we are allowed to insert new cost into the tick scope, we can float them upwards to the rule application site. Moreover, we may encounter ticks in the template of a rule. There are a few ways in which these may be introduced (e.g. #18162, #17619). Such ticks are ignored by the matcher. See Note [Simplifying rules] in GHC.Core.Opt.Simplify.Utils for details. cf Note [Tick annotations in call patterns] in GHC.Core.Opt.SpecConstr
References 2
- Simplifying rules GHC.Core.Opt.Simplify.Utils
- Tick annotations in call patterns GHC.Core.Opt.SpecConstr
Referenced by 4
- Simplifying rules GHC.Core.Opt.Simplify.Utils
- Tick annotations in call patterns GHC.Core.Opt.SpecConstr
- Ticks on applications GHC.Core.Opt.Specialise
- GHC.Core.Rules call site