<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Aditya,<div class=""><br class=""></div><div class="">Thanks for working on this :).<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 2, 2018, at 11:21 PM, Aditya Kumar via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Author: hiraditya<br class="">Date: Tue Oct  2 23:21:05 2018<br class="">New Revision: 343663<br class=""><br class="">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=343663&view=rev" class="">http://llvm.org/viewvc/llvm-project?rev=343663&view=rev</a><br class="">Log:<br class="">Improve static analysis of cold basic blocks<br class=""><br class="">Differential Revision: <a href="https://reviews.llvm.org/D52704" class="">https://reviews.llvm.org/D52704</a><br class=""><br class="">Reviewers: sebpop, tejohnson, brzycki, SirishP<br class="">Reviewed By: sebpop<br class=""><br class="">Modified:<br class="">    llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp<br class=""><br class="">Modified: llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp<br class="">URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp?rev=343663&r1=343662&r2=343663&view=diff" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp?rev=343663&r1=343662&r2=343663&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp (original)<br class="">+++ llvm/trunk/lib/Transforms/IPO/HotColdSplitting.cpp Tue Oct  2 23:21:05 2018<br class="">@@ -111,6 +111,18 @@ bool blockEndsInUnreachable(const BasicB<br class="">   return succ_empty(&BB);<br class=""> }<br class=""><br class="">+static bool exceptionHandlingFunctions(const CallInst *CI) {<br class=""></div></div></blockquote><div><br class=""></div><div>Could you use verb phrases for function names (see <a href="https://www.llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly" class="">https://www.llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly</a>)?</div><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div class="">+  auto F = CI->getCalledFunction();<br class="">+  if (!F)<br class="">+    return false;<br class="">+  auto FName = F->getName();<br class="">+  return FName == "__cxa_begin_catch" ||<br class="">+         FName == "__cxa_free_exception" ||<br class="">+         FName == "__cxa_allocate_exception" ||<br class="">+         FName == "__cxa_begin_catch" ||<br class="">+         FName == "__cxa_end_catch”;<br class=""></div></div></blockquote><div><br class=""></div><div>Given how hot this might be, would it make sense to return early if, say, the name doesn’t begin with “__”? Ideally we’d use some sort of off-the-shelf multi-string matching function, but absent that..</div><div><br class=""></div><div>thanks,</div><div>vedant</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">+}<br class="">+<br class=""> static<br class=""> bool unlikelyExecuted(const BasicBlock &BB) {<br class="">   if (blockEndsInUnreachable(BB))<br class="">@@ -122,7 +134,8 @@ bool unlikelyExecuted(const BasicBlock &<br class="">     if (const CallInst *CI = dyn_cast<CallInst>(&I)) {<br class="">       // The block is cold if it calls functions tagged as cold or noreturn.<br class="">       if (CI->hasFnAttr(Attribute::Cold) ||<br class="">-          CI->hasFnAttr(Attribute::NoReturn))<br class="">+          CI->hasFnAttr(Attribute::NoReturn) ||<br class="">+          exceptionHandlingFunctions(CI))<br class="">         return true;<br class=""><br class="">       // Assume that inline assembly is hot code.<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" class="">llvm-commits@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits<br class=""></div></div></blockquote></div><br class=""></div></body></html>