about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/attributes.rs
diff options
context:
space:
mode:
authorFolkert de Vries <folkert@folkertdev.nl>2025-06-22 00:47:10 +0200
committerFolkert de Vries <folkert@folkertdev.nl>2025-06-22 00:47:10 +0200
commita123a36a1f52fa8ac85bfa1ba4cef7062058db7b (patch)
tree4841afb63c3ca842b4da06ca70a12b564b9cdeec /compiler/rustc_codegen_llvm/src/attributes.rs
parent6d0c9e2a1c80e350c50f5fb9338ea9e585ec603b (diff)
downloadrust-a123a36a1f52fa8ac85bfa1ba4cef7062058db7b.tar.gz
rust-a123a36a1f52fa8ac85bfa1ba4cef7062058db7b.zip
centralize `-Zmin-function-alignment` logic
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/attributes.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/attributes.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_llvm/src/attributes.rs b/compiler/rustc_codegen_llvm/src/attributes.rs
index 27fd09745ff..adb53e0b66c 100644
--- a/compiler/rustc_codegen_llvm/src/attributes.rs
+++ b/compiler/rustc_codegen_llvm/src/attributes.rs
@@ -491,11 +491,7 @@ pub(crate) fn llfn_attrs_from_instance<'ll, 'tcx>(
         let allocated_pointer = AttributeKind::AllocatedPointer.create_attr(cx.llcx);
         attributes::apply_to_llfn(llfn, AttributePlace::Argument(0), &[allocated_pointer]);
     }
-    // function alignment can be set globally with the `-Zmin-function-alignment=<n>` flag;
-    // the alignment from a `#[repr(align(<n>))]` is used if it specifies a higher alignment.
-    if let Some(align) =
-        Ord::max(cx.tcx.sess.opts.unstable_opts.min_function_alignment, codegen_fn_attrs.alignment)
-    {
+    if let Some(align) = codegen_fn_attrs.alignment {
         llvm::set_alignment(llfn, align);
     }
     if let Some(backchain) = backchain_attr(cx) {