
#12463: SPECIALIZABLE pragma? -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: feature request | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: Inlining Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari):
Is that what you mean Ben? My questions are
1. Why would you mark your function as `INLINABLE` rather than `RECURSIVE_SPECIALISABLE`?
`RECURSIVE_SPECIALISABLE` carries a potentially significant cost above `INLINEABLE` as it may produce many more inlinings which we have to later read and decide whether to use at every callsite.
2. What advantages does this pragma have over including the unfoldings of all polymorphic functions?
This is a good question. It depends upon whether we feel that the costs above are large enough to warrant yet another pragma. Frankly, users complain a great deal about compiler performance and one of the reasons for this is that GHC applies all of its might to all of the code it compiles with `-O`. In light of this it seems like giving GHC more information about where it should be focusing its attention may be worthwhile. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12463#comment:15 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler