
Wait, inlinable creates a new specialization automatically at each new
instances / use site? I always thought it just allows invoking specialize
pragma in client modules.
On Thursday, January 28, 2016, Simon Peyton Jones
I think the difference between the inlinable and specialize pragma is whether the specialization needs to be driven by the call site or not. If you have a handful of known types you want to specialize for up front, you can use the specialize pragma. If the set is large or unknown (like in the case of container keys/value, the inlinable pragma does the right thing.)
Correct! And not well described anywhere.
If someone writes something, I’ll willingly review
S
*From:* Johan Tibell [mailto:johan.tibell@gmail.com javascript:_e(%7B%7D,'cvml','johan.tibell@gmail.com');] *Sent:* 28 January 2016 13:40 *To:* Simon Peyton Jones
javascript:_e(%7B%7D,'cvml','simonpj@microsoft.com');> *Cc:* Conal Elliott javascript:_e(%7B%7D,'cvml','conal@conal.net');>; ghc-devs@haskell.org javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org'); *Subject:* Re: More aggressive dictionary removal? I think the difference between the inlinable and specialize pragma is whether the specialization needs to be driven by the call site or not. If you have a handful of known types you want to specialize for up front, you can use the specialize pragma. If the set is large or unknown (like in the case of container keys/value, the inlinable pragma does the right thing.)
On Thu, Jan 28, 2016 at 1:54 PM, Simon Peyton Jones
javascript:_e(%7B%7D,'cvml','simonpj@microsoft.com');> wrote: Aggressive inlining is one way, but specialisation ought to get a long way, and makes fewer copies of the specialised code.
It’s hard to help without a concrete example
Simon
*From:* ghc-devs [mailto:ghc-devs-bounces@haskell.org javascript:_e(%7B%7D,'cvml','ghc-devs-bounces@haskell.org');] *On Behalf Of *Conal Elliott *Sent:* 28 January 2016 00:05 *To:* ghc-devs@haskell.org javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org'); *Subject:* More aggressive dictionary removal?
I'm looking for pointers on getting GHC to eliminate more overloading & polymorphism. I think this sort of thing mainly happens in the Specialise module. The default GHC flag settings get me a couple levels of monomorphization and dictionary removal, but I want to go further. I've tried -fspecialise-aggressively, but it didn't seem to make a difference, and I haven't found this flag described in the GHC user's guide. Anyone have pointers to more information?
Thanks, - Conal
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org'); http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.haskell.org%2fcgi-bin%2fmailman%2flistinfo%2fghc-devs&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7c5939cd4041e84aa62b2408d327e89e34%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=sx95mmcTZxoS64z47uYAcR7n8iYq78JeMKFjdi%2bZDpw%3d