<div dir="ltr"><div><div>Thanks, Eli! I would have done a lame one-off fix if left on my own, but let me try for the better fix...<br></div><br>I found some more background for the CGP and SDAG behaviors. We're intentionally not checking for nobuiltin in CGP on fortified calls after:<br><a href="https://bugs.llvm.org/show_bug.cgi?id=23093">https://bugs.llvm.org/show_bug.cgi?id=23093</a><br><a href="https://reviews.llvm.org/rL233776">https://reviews.llvm.org/rL233776</a><br><br></div>The SDAG checks were added with the sanitizers in mind:<br><a href="https://reviews.llvm.org/D19781">https://reviews.llvm.org/D19781</a><br><a href="https://reviews.llvm.org/D19801">https://reviews.llvm.org/D19801</a><br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 8, 2017 at 11:28 AM, Friedman, Eli <span dir="ltr"><<a href="mailto:efriedma@codeaurora.org" target="_blank">efriedma@codeaurora.org</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 6/8/2017 10:09 AM, Sanjay Patel via llvm-commits wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: spatel<br>
Date: Thu JunĀ 8 12:09:18 2017<br>
New Revision: 304991<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=304991&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=304991&view=rev</a><br>
Log:<br>
[PowerPC] add memcmp test with nobuiltin attr; NFC<br>
<br>
In SDAG, we don't expand libcalls with a nobuiltin attribute.<br>
It's not clear if that's correct from the existing code comment:<br>
"Don't do the check if marked as nobuiltin for some reason."<br>
<br>
...adding a test here either way to show that there is currently<br>
a different behavior implemented in the CGP-based expansion.<br>
</blockquote>
<br></span>
It's unlikely to actually cause problems for memcmp specifically (freestanding environments are supposed to have a standard memcmp anyway), but we probably should fix this for so someone doesn't accidentally copy-paste it somewhere it does matter.<br>
<br>
We should add an overload of TargetLibraryInfo::getLibFunc which takes a CallSite, so it's harder to make this mistake.<span class="HOEnZb"><font color="#888888"><br>
<br>
-Eli<br>
<br>
-- <br>
Employee of Qualcomm Innovation Center, Inc.<br>
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project<br>
<br>
</font></span></blockquote></div><br></div>