[PATCH] D130751: [BOLT] Postprocess entry points after disassembly

Huan Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 29 02:34:27 PDT 2022


nhuhuan created this revision.
Herald added a reviewer: rafauler.
Herald added a subscriber: ayermolo.
Herald added a reviewer: Amir.
Herald added a reviewer: maksfb.
Herald added a project: All.
nhuhuan requested review of this revision.
Herald added subscribers: llvm-commits, yota9.
Herald added a project: LLVM.

When processing split jump tables and split landing pad, BOLT generates
additional secondary entry points, which all then should go through the
postprocessing checks.

In this update, postProcessEntryPoints is performed after disassembly
and branch analysis are completed.

Test Plan:

  ninja check-bolt


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D130751

Files:
  bolt/lib/Rewrite/RewriteInstance.cpp


Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -2898,11 +2898,8 @@
 
   for (auto &BFI : BC->getBinaryFunctions()) {
     BinaryFunction &Function = BFI.second;
-
     if (!shouldDisassemble(Function))
       continue;
-
-    Function.postProcessEntryPoints();
     Function.postProcessJumpTables();
   }
 
@@ -2939,6 +2936,15 @@
         !BC->getFragmentsToSkip().count(&Function))
       Function.parseLSDA(getLSDAData(), getLSDAAddress());
   }
+
+  // Split jump table, split landing pad register secondary entry points
+  // postProcessEntryPoints needs to be invoked in the end
+  for (auto &BFI : BC->getBinaryFunctions()) {
+    BinaryFunction &Function = BFI.second;
+    if (!shouldDisassemble(Function))
+      continue;
+    Function.postProcessEntryPoints();
+  }
 }
 
 void RewriteInstance::buildFunctionsCFG() {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130751.448556.patch
Type: text/x-patch
Size: 977 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220729/87dc2449/attachment.bin>


More information about the llvm-commits mailing list