[PATCH] D159548: [BOLT][AArch64] Fix CI alignment
Vladislav Khmelevsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 28 01:56:22 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG08086c1529ab: [BOLT][AArch64] Fix CI alignment (authored by yota9).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159548/new/
https://reviews.llvm.org/D159548
Files:
bolt/lib/Passes/Aligner.cpp
Index: bolt/lib/Passes/Aligner.cpp
===================================================================
--- bolt/lib/Passes/Aligner.cpp
+++ bolt/lib/Passes/Aligner.cpp
@@ -158,25 +158,27 @@
BinaryContext::IndependentCodeEmitter Emitter =
BC.createIndependentMCCodeEmitter();
- if (opts::UseCompactAligner)
- alignCompact(BF, Emitter.MCE.get());
- else
- alignMaxBytes(BF);
-
// Align objects that contains constant islands and no code
// to at least 8 bytes.
if (!BF.size() && BF.hasIslandsInfo()) {
- const uint16_t Alignment = BF.getConstantIslandAlignment();
- if (BF.getAlignment() < Alignment)
- BF.setAlignment(Alignment);
-
- if (BF.getMaxAlignmentBytes() < Alignment)
- BF.setMaxAlignmentBytes(Alignment);
-
- if (BF.getMaxColdAlignmentBytes() < Alignment)
- BF.setMaxColdAlignmentBytes(Alignment);
+ 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;
}
+ if (opts::UseCompactAligner)
+ alignCompact(BF, Emitter.MCE.get());
+ else
+ alignMaxBytes(BF);
+
if (opts::AlignBlocks && !opts::PreserveBlocksAlignment)
alignBlocks(BF, Emitter.MCE.get());
};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159548.557436.patch
Type: text/x-patch
Size: 1623 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230928/5b578acc/attachment.bin>
More information about the llvm-commits
mailing list