<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 10, 2016 at 2:56 PM, Richard Trieu <span dir="ltr"><<a href="mailto:rtrieu@google.com" target="_blank">rtrieu@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This appears to be buggy in the original since the similar function isHotFunction has null checks.  This was detected during a test of optimizations with the latest Clang.</div></blockquote><div><br></div><div>So existing regression tests cover this/it was failing on buildbots?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 10, 2016 at 10:14 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Tested? (is this covered by an existing test, just was buggy in the original commit & revealed by a buildbot (asan, etc)?)</div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 9, 2016 at 6:42 PM, Richard Trieu via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rtrieu<br>
Date: Thu Jun  9 20:42:05 2016<br>
New Revision: 272359<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=272359&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=272359&view=rev</a><br>
Log:<br>
Add null checks before using a pointer.<br>
<br>
Modified:<br>
    llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp<br>
<br>
Modified: llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp?rev=272359&r1=272358&r2=272359&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp?rev=272359&r1=272358&r2=272359&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp (original)<br>
+++ llvm/trunk/lib/Analysis/ProfileSummaryInfo.cpp Thu Jun  9 20:42:05 2016<br>
@@ -84,9 +84,13 @@ bool ProfileSummaryInfo::isHotFunction(c<br>
 // example, no profile data is available).<br>
 bool ProfileSummaryInfo::isColdFunction(const Function *F) {<br>
   computeSummary();<br>
+  if (!F)<br>
+    return false;<br>
   if (F->hasFnAttribute(Attribute::Cold)) {<br>
     return true;<br>
   }<br>
+  if (!Summary)<br>
+    return false;<br>
   auto FunctionCount = F->getEntryCount();<br>
   // FIXME: The heuristic used below for determining coldness is based on<br>
   // preliminary SPEC tuning for inliner. This will eventually be a<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>