Skip to content

Add INLINE pragmas for Enum helper methods

Simon Peyton Jones requested to merge wip/T21343 into master

As #21343 (closed) showed, we need to be super-certain that the "helper methods" for Enum instances are actually inlined or specialised.

I also tripped over this when I discovered that numericEnumFromTo and friends had no pragmas at all, so their performance was very fragile. If they weren't inlined, all bets were off. So I've added INLINE pragmas for them too.

See new Note [Inline Enum method helpers] in GHC.Enum.

I also expanded Note [Checking for INLINE loop breakers] in GHC.Core.Lint to explain why an INLINE function might temporarily be a loop breaker -- this was the initial bug report in #21343 (closed).

Merge request reports