Opened 11 months ago

Last modified 2 months ago

#12178 new feature request

Allow inline pragmas on pattern synonyms

Reported by: mpickering Owned by:
Priority: high Milestone: 8.4.1
Component: Compiler Version: 8.0.1
Keywords: PatternSynonyms Cc: bgamari, edsko
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:


Richard observes that it might be useful to allow inline pragmas to refer to pattern synonyms to ensure that the matcher is inlined.

The main question to resolve is whether {-# INLINE P #-} means to inline just the matcher, just the builder or both. It seems that without more fine grained control then the pragma should cause both the matcher and builder to be inline but I am not certain about this.

Change History (5)

comment:1 Changed 9 months ago by edsko

Cc: edsko added

comment:2 Changed 9 months ago by bgamari

Cc: bgamari added
Priority: normalhigh

Bumping the importance of this since you really should be able to use pattern synonyms in a manner without compromising performance.

Moreover, I wonder whether builders and matchers should be given a bit of a discount for their inlining cost, reflecting the user's likely intuition that patterns synonyms are generally cheap and small.

I agree that a simple INLINE P pragma should inline both the matcher and the builder of P. Indeed we could expose INLINE_MATCHER and INLINE_BUILDER variants as well, although I am doubtful that they would pull their weight.

Last edited 9 months ago by bgamari (previous) (diff)

comment:3 Changed 9 months ago by goldfire

I hate to say it, but I feel confident someone will want the finer control here. But I suppose there would be no barrier to implementing the finer control later and so we should start with the simpler version.

comment:4 Changed 8 months ago by bgamari

Milestone: 8.2.1

comment:5 Changed 2 months ago by bgamari


Sadly this won't happen for 8.2.

Last edited 2 months ago by bgamari (previous) (diff)
Note: See TracTickets for help on using tickets.