[PATCH] D137620: [BOLT] Don't align .text to pageAlign

Denis Revunov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 8 05:57:57 PST 2022


treapster updated this revision to Diff 473971.
treapster added a comment.

Turns out we cannot remove padding with -hugify, so i preserve it in this case and hope all tests will pass.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137620

Files:
  bolt/lib/Rewrite/MachORewriteInstance.cpp
  bolt/lib/Rewrite/RewriteInstance.cpp
  bolt/lib/Utils/CommandLineOpts.cpp


Index: bolt/lib/Utils/CommandLineOpts.cpp
===================================================================
--- bolt/lib/Utils/CommandLineOpts.cpp
+++ bolt/lib/Utils/CommandLineOpts.cpp
@@ -42,7 +42,7 @@
 
 cl::opt<unsigned> AlignText("align-text",
                             cl::desc("alignment of .text section"), cl::Hidden,
-                            cl::cat(BoltCategory));
+                            cl::init(64), cl::cat(BoltCategory));
 
 cl::opt<unsigned> AlignFunctions(
     "align-functions",
Index: bolt/lib/Rewrite/RewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/RewriteInstance.cpp
+++ bolt/lib/Rewrite/RewriteInstance.cpp
@@ -1778,7 +1778,7 @@
     opts::UseOldText = false;
   }
 
-  if (!opts::AlignText.getNumOccurrences())
+  if (opts::Hugify)
     opts::AlignText = BC->PageAlign;
 
   if (opts::AlignText < opts::AlignFunctions)
Index: bolt/lib/Rewrite/MachORewriteInstance.cpp
===================================================================
--- bolt/lib/Rewrite/MachORewriteInstance.cpp
+++ bolt/lib/Rewrite/MachORewriteInstance.cpp
@@ -606,10 +606,6 @@
 }
 
 void MachORewriteInstance::adjustCommandLineOptions() {
-//FIXME! Upstream change
-//  opts::CheckOverlappingElements = false;
-  if (!opts::AlignText.getNumOccurrences())
-    opts::AlignText = BC->PageAlign;
   if (opts::Instrument.getNumOccurrences())
     opts::ForcePatch = true;
   opts::JumpTables = JTS_MOVE;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137620.473971.patch
Type: text/x-patch
Size: 1473 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221108/866d7dfd/attachment.bin>


More information about the llvm-commits mailing list