[llvm] [BOLT] Return proper minimal alignment from BF (PR #67707)

Job Noorman via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 21 04:05:53 PDT 2023


================
@@ -158,21 +158,13 @@ void AlignerPass::runOnFunctions(BinaryContext &BC) {
     BinaryContext::IndependentCodeEmitter Emitter =
         BC.createIndependentMCCodeEmitter();
 
-    // Align objects that contains constant islands and no code
-    // to at least 8 bytes.
-    if (!BF.size() && BF.hasIslandsInfo()) {
-      uint16_t Alignment = BF.getConstantIslandAlignment();
-      // Check if we're forcing output alignment and it is greater than minimal
-      // CI required one
-      if (!opts::UseCompactAligner && Alignment < opts::AlignFunctions &&
-          opts::AlignFunctions <= opts::AlignFunctionsMaxBytes)
-        Alignment = opts::AlignFunctions;
-
-      BF.setAlignment(Alignment);
-      BF.setMaxAlignmentBytes(Alignment);
-      BF.setMaxColdAlignmentBytes(Alignment);
-      return;
-    }
+    // Minimal code alignment on AArch64 is 4
+    if (BC.isAArch64())
----------------
mtvec wrote:

I completely missed this ping, sorry about that! Follow-up in #69837.

https://github.com/llvm/llvm-project/pull/67707


More information about the llvm-commits mailing list