Skip to content

Commit cd5658e

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 f520900 commit cd5658e

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,10 @@ pub(crate) unsafe fn create_module<'ll>(
202202
// LLVM 22 updated the NVPTX layout to indicate 256-bit vector load/store: https://github.com/llvm/llvm-project/pull/155198
203203
target_data_layout = target_data_layout.replace("-i256:256", "");
204204
}
205+
if sess.target.arch == Arch::PowerPC64 {
206+
// LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673
207+
target_data_layout = target_data_layout.replace("64-f64:32:", "");
208+
}
205209
}
206210

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ 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".into(),
2121
arch: Arch::PowerPC64,
2222
options: base,
2323
}

0 commit comments

Comments
 (0)