Update AMDGPU data layout

This commit is contained in:
Nikita Popov
2025-07-09 14:18:37 +02:00
parent 1aa5b22465
commit 63e1074c97
2 changed files with 6 additions and 1 deletions

View File

@@ -207,6 +207,11 @@ pub(crate) unsafe fn create_module<'ll>(
// LLVM 21 updated the default layout on nvptx: https://github.com/llvm/llvm-project/pull/124961
target_data_layout = target_data_layout.replace("e-p6:32:32-i64", "e-i64");
}
if sess.target.arch == "amdgpu" {
// LLVM 21 adds the address width for address space 8.
// See https://github.com/llvm/llvm-project/pull/139419
target_data_layout = target_data_layout.replace("p8:128:128:128:48", "p8:128:128")
}
}
// Ensure the data-layout values hardcoded remain the defaults.