[llvm] IR: Add prefalign attribute for function definitions. (PR #155527)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 29 06:09:06 PST 2026


================
@@ -4213,6 +4213,8 @@ void AssemblyWriter::printFunction(const Function *F) {
   maybePrintComdat(Out, *F);
   if (MaybeAlign A = F->getAlign())
     Out << " align " << A->value();
+  if (MaybeAlign A = F->getPreferredAlignment())
+    Out << " prefalign " << A->value();
----------------
arsenm wrote:

align has a legacy syntax without parens around the value. The parser supports the `align(N)` form but never got around to upgrading all the tests to switch the printed format. This should use `prefalign(N)`

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


More information about the llvm-commits mailing list