Skip to content

Conversation

pcc
Copy link
Contributor

@pcc pcc commented Aug 26, 2025

MaxAlignment is used to produce the abbreviation for MODULE_CODE_GLOBALVAR
and is not used for anything related to function alignments, so stop
combining function alignments and rename it to make its purpose clearer.

Created using spr 1.3.6-beta.1
@pcc pcc requested a review from teresajohnson August 26, 2025 01:51
Copy link

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
View the diff from clang-format here.
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index a1d5b36bd..e0e0bf149 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1499,7 +1499,8 @@ void ModuleBitcodeWriter::writeModuleInfo() {
   unsigned MaxGlobalType = 0;
   for (const GlobalVariable &GV : M.globals()) {
     if (MaybeAlign A = GV.getAlign())
-      MaxGVarAlignment = !MaxGVarAlignment ? *A : std::max(*MaxGVarAlignment, *A);
+      MaxGVarAlignment =
+          !MaxGVarAlignment ? *A : std::max(*MaxGVarAlignment, *A);
     MaxGlobalType = std::max(MaxGlobalType, VE.getTypeID(GV.getValueType()));
     if (GV.hasSection()) {
       // Give section names unique ID's.

Copy link
Contributor

@teresajohnson teresajohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@pcc pcc merged commit a1eeb59 into main Aug 26, 2025
9 of 10 checks passed
@pcc pcc deleted the users/pcc/spr/bitcode-stop-combining-function-alignments-into-maxalignment branch August 26, 2025 18:22
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Aug 26, 2025
…ent.

MaxAlignment is used to produce the abbreviation for MODULE_CODE_GLOBALVAR
and is not used for anything related to function alignments, so stop
combining function alignments and rename it to make its purpose clearer.

Reviewers: teresajohnson

Reviewed By: teresajohnson

Pull Request: llvm/llvm-project#155341
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants