<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 8 April 2013 10:06, Timon Gehr <span dir="ltr"><<a href="mailto:timon.gehr@gmx.ch" target="_blank">timon.gehr@gmx.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 04/08/2013 10:29 AM, Iain Buclaw wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On 6 April 2013 12:09, bearophile <<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a><br></div><div><div class="h5">
<mailto:<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.<u></u>com</a>>> wrote:<br>
<br>
    I remember Walter saying two or more times that the semantics of D<br>
    offers some optimization opportunities that probably are not yet<br>
    used to try to reduce the run-time of D programs. Is Walter willing<br>
    to write down a list of such opportunities? (Ideas from other<br>
    persons are welcome). Maybe some LDC/GDC developer will make the<br>
    GCC/LLVM back-ends use them. The implementation of those ideas will<br>
    require some time, so later it's better to put the list in the D wiki.<br>
<br>
    Bye,<br>
    bearophile<br>
<br>
<br>
<br></div></div><div class="im">
This information could possibly be helpful.  Though given that most of<br>
(gdc) codegen is on par with g++, there's probably not much on the list<br>
that isn't already detected by the backend optimisation passes.<br>
<br>
<br>
--<br>
Iain Buclaw<br>
<br>
*(p < e ? p++ : p) = (c & 0x0f) + '0';<br>
</div></blockquote>
<br>
Does GDC use the additional type information for optimization? Eg. if something is immutable, then aliasing issues do not have to be considered for it when reading and writing through multiple pointers repeatedly.<br>
</blockquote></div><br></div><div class="gmail_extra">It uses some type information, eg:<br><br></div><div class="gmail_extra">const/immutable/wild  -> qualified const.<br></div><div class="gmail_extra">shared -> qualified volatile.<br>
</div><div class="gmail_extra">shared + const/wild -> qualified const/volatile.<br clear="all"></div><div class="gmail_extra"><br><br></div><div class="gmail_extra">Done nothing in regards to C 'restrict' optimisations.  However the D array .ptr type could also be considered 'restrict' also.<br>
<br></div><div class="gmail_extra"><br>-- <br>Iain Buclaw<br><br>*(p < e ? p++ : p) = (c & 0x0f) + '0';
</div></div>