Skip to content

Commit 27076c4

Browse files
committed
Update amdgpu data layout
This changed in: llvm/llvm-project@853760b
1 parent abc573d commit 27076c4

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

compiler/rustc_codegen_llvm/src/context.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,11 @@ pub(crate) unsafe fn create_module<'ll>(
215215
// LLVM 22 updated the ABI alignment for double on AIX: https://github.com/llvm/llvm-project/pull/144673
216216
target_data_layout = target_data_layout.replace("-f64:32:64", "");
217217
}
218+
if sess.target.arch == Arch::AmdGpu {
219+
// LLVM 22 specified ELF mangling in the amdgpu data layout:
220+
// https://github.com/llvm/llvm-project/pull/163011
221+
target_data_layout = target_data_layout.replace("-e:m", "");
222+
}
218223
}
219224

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::spec::{
55
pub(crate) fn target() -> Target {
66
Target {
77
arch: Arch::AmdGpu,
8-
data_layout: "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(),
8+
data_layout: "e-m:e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128:128:48-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9".into(),
99
llvm_target: "amdgcn-amd-amdhsa".into(),
1010
metadata: TargetMetadata {
1111
description: Some("AMD GPU".into()),

0 commit comments

Comments
 (0)