[PATCH] D69257: Outline non returning functions unless a longjmp

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 10:37:03 PDT 2019


hiraditya updated this revision to Diff 225916.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D69257/new/

https://reviews.llvm.org/D69257

Files:
  llvm/lib/Transforms/IPO/HotColdSplitting.cpp


Index: llvm/lib/Transforms/IPO/HotColdSplitting.cpp
===================================================================
--- llvm/lib/Transforms/IPO/HotColdSplitting.cpp
+++ llvm/lib/Transforms/IPO/HotColdSplitting.cpp
@@ -117,9 +117,10 @@
   if (blockEndsInUnreachable(BB)) {
     if (auto *CI =
             dyn_cast_or_null<CallInst>(BB.getTerminator()->getPrevNode()))
-      if (CI->hasFnAttr(Attribute::NoReturn))
-        return false;
-    return true;
+      if (CI->hasFnAttr(Attribute::NoReturn)) {
+        IntrinsicInst *II = dyn_cast<IntrinsicInst>(CI);
+        return II->getIntrinsicID() != Intrinsic::longjmp;
+      }
   }
 
   return false;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69257.225916.patch
Type: text/x-patch
Size: 660 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191021/91400d78/attachment.bin>


More information about the llvm-commits mailing list