<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="">Hm, it should be reasonable to add a test for this as well.<div class=""><br class=""></div><div class="">vedant<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 3, 2018, at 6:36 PM, Vedant 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=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">Hi Aditya,</span><div class="" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br class=""></div><div class="" style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">Thanks for working on this :).<br class=""><div class=""><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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:<span class="Apple-converted-space"> </span><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 class=""><br class=""></div><div class="">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 class=""><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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">thanks,</div><div class="">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=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class=""></div></div></blockquote></div><br class=""></div><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><span style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;" class="">llvm-commits mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="mailto:llvm-commits@lists.llvm.org" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">llvm-commits@lists.llvm.org</a><br style="caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;" class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="font-family: Helvetica; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a></div></blockquote></div><br class=""></div></body></html>