[llvm-branch-commits] [clang] CodeGen, Driver: Introduce -fpreferred-function-alignment option. (PR #155528)

Peter Collingbourne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jan 14 11:20:08 PST 2026


================
@@ -8695,6 +8697,9 @@ def fencode_extended_block_signature : Flag<["-"], "fencode-extended-block-signa
 def function_alignment : Separate<["-"], "function-alignment">,
     HelpText<"default alignment for functions">,
     MarshallingInfoInt<LangOpts<"FunctionAlignment">>;
+def preferred_function_alignment : Separate<["-"], "preferred-function-alignment">,
+    HelpText<"preferred alignment for functions">,
+    MarshallingInfoInt<LangOpts<"PreferredFunctionAlignment">>;
----------------
pcc wrote:

> Based on the docs, I have no idea how this new option differs from -ffunction-alignment which sets the default function alignment.

Let me add an explanation to UsersManual.rst based on the LangRef update in #155527.

> Also, what happens when the user sets both on the command line? (This should be added as a test case.)

In that case, the preferred alignment is ignored. I'll add a test case for that.

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


More information about the llvm-branch-commits mailing list