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. <span></span><br><br>On Thursday, January 28, 2016, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:36.0pt">
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.)<u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Correct! And not well described anywhere.
<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">If someone writes something, I’ll willingly review<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">S<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Johan Tibell [mailto:<a href="javascript:_e(%7B%7D,'cvml','johan.tibell@gmail.com');" target="_blank">johan.tibell@gmail.com</a>]
<br>
<b>Sent:</b> 28 January 2016 13:40<br>
<b>To:</b> Simon Peyton Jones <<a href="javascript:_e(%7B%7D,'cvml','simonpj@microsoft.com');" target="_blank">simonpj@microsoft.com</a>><br>
<b>Cc:</b> Conal Elliott <<a href="javascript:_e(%7B%7D,'cvml','conal@conal.net');" target="_blank">conal@conal.net</a>>; <a href="javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org');" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> Re: More aggressive dictionary removal?<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
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.)<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On Thu, Jan 28, 2016 at 1:54 PM, Simon Peyton Jones <<a href="javascript:_e(%7B%7D,'cvml','simonpj@microsoft.com');" target="_blank">simonpj@microsoft.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Aggressive inlining is one way, but specialisation ought to get a long way, and makes fewer copies of the specialised code.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">It’s hard to help without a concrete example</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif">Simon</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"> </span><u></u><u></u></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ghc-devs
[mailto:<a href="javascript:_e(%7B%7D,'cvml','ghc-devs-bounces@haskell.org');" target="_blank">ghc-devs-bounces@haskell.org</a>]
<b>On Behalf Of </b>Conal Elliott<br>
<b>Sent:</b> 28 January 2016 00:05<br>
<b>To:</b> <a href="javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org');" target="_blank">ghc-devs@haskell.org</a><br>
<b>Subject:</b> More aggressive dictionary removal?</span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">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?<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:6.0pt">Thanks, - Conal<u></u><u></u></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="javascript:_e(%7B%7D,'cvml','ghc-devs@haskell.org');" target="_blank">ghc-devs@haskell.org</a><br>
<a href="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" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</blockquote>