<div dir="ltr">Why do memcpy and memmove both exist?  Why did C99 introduce restrict?  Why does Fortran prohibit aliasing?<div><br></div><div>I have measured the benefits of restrict semantics w.r.t. vectorization many times in the past, enough that I did not bother to benchmark this specific case.<br><div><br>Jeff</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 8:02 AM, Dave Goodell (dgoodell) <span dir="ltr"><<a href="mailto:dgoodell@cisco.com" target="_blank">dgoodell@cisco.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Nov 11, 2015, at 9:47 AM, Jeff Hammond <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>> wrote:<br>
<br>
> Is there a reason why buf and result can't be restrict pointers?  I see zero value in enabling the case of aliased local buffers when the side effects are (1) a const buffer is modified and (2) the potential code optimization demonstrated in my pull request is disallowed (without specializing the macro for the aliased and non-aliased cases, of course).<br>
<br>
</span>Let's flip that around: do you have any empirical evidence that this API design decision is actually affecting performance in a noticeable way?  "I would like it to look differently, and I *think* there's optimization potential" is a weak argument.<br>
<span class="HOEnZb"><font color="#888888"><br>
-Dave<br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Jeff Hammond<br><a href="mailto:jeff.science@gmail.com" target="_blank">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/" target="_blank">http://jeffhammond.github.io/</a></div>
</div>