[GHC] #12463: SPECIALIZABLE pragma?
GHC
ghc-devs at haskell.org
Wed Sep 28 12:17:59 UTC 2016
#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 mpickering):
Here is my understanding of what Ben means.
---
We introduce a new top-level pragma which is introduced the the syntax
`{-# RECURSIVE_SPECIALISABLE varid #-}`.
Only top-level functions can be marked with this pragma.
For a function `f` which is marked with `RECURSIVE_SPECIALISABLE`:
1. When `f` is exported, `f`'s unfolding is included in the interface
file. (As if `f` was marked `INLINABLE`).
2. When `f` is used in the definition of another function `g`, `g`'s
unfolding is included in the interface file when `g` is exported. (As if
`g` was marked `INLINABLE`).
---
Is that what you mean Ben? My questions are
1. Why would you mark your function as `INLINABLE` rather than
`RECURSIVE_SPECIALISABLE`?
2. What advantages does this pragma have over including the unfoldings of
all polymorphic functions ?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12463#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list