Skip to content

Commit accfc34

Browse files
committed
rustc_codegen_llvm: update alignment for double on AIX
This was recently fixed upstream in LLVM, so we update our default layout to match. @rustbot label: +llvm-main
1 parent bd33b83 commit accfc34

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ pub(crate) unsafe fn create_module<'ll>(
211211
// LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198
212212
target_data_layout = target_data_layout.replace("-i256:256", "");
213213
}
214+
if sess.target.arch == Arch::PowerPC64 {
215+
// LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673
216+
target_data_layout = target_data_layout.replace("-f64:32:64", "");
217+
}
214218
}
215219

216220
// Ensure the data-layout values hardcoded remain the defaults.

compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ pub(crate) fn target() -> Target {
1717
std: None, // ?
1818
},
1919
pointer_width: 64,
20-
data_layout: "E-m:a-Fi64-i64:64-i128:128-n32:64-S128-v256:256:256-v512:512:512".into(),
20+
data_layout: "E-m:a-Fi64-i64:64-i128:128-n32:64-f64:32:64-S128-v256:256:256-v512:512:512"
21+
.into(),
2122
arch: Arch::PowerPC64,
2223
options: base,
2324
}

0 commit comments

Comments
 (0)