[PATCH] D104202: Calculate getTerminator only when necessary

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 13 11:33:10 PDT 2021


hiraditya created this revision.
Herald added a subscriber: ormris.
hiraditya requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104202

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
@@ -150,9 +150,10 @@
   //
   // Resumes that are not reachable from a cleanup landing pad are considered to
   // be unreachable. It’s not safe to split them out either.
+  if (BB.hasAddressTaken() || BB.isEHPad())
+    return false;
   auto Term = BB.getTerminator();
-  return !BB.hasAddressTaken() && !BB.isEHPad() && !isa<InvokeInst>(Term) &&
-         !isa<ResumeInst>(Term);
+  return !isa<InvokeInst>(Term) && !isa<ResumeInst>(Term);
 }
 
 /// Mark \p F cold. Based on this assumption, also optimize it for minimum size.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104202.351733.patch
Type: text/x-patch
Size: 749 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210613/2eb2f59e/attachment.bin>


More information about the llvm-commits mailing list