about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorNikita Popov <npopov@redhat.com>2025-07-09 14:18:37 +0200
committerNikita Popov <npopov@redhat.com>2025-07-18 09:35:11 +0200
commit63e1074c97b60d248f86321f021871f93ba10c31 (patch)
tree27756871cd14deb74c6b715b4afde3d7933839a3 /compiler/rustc_codegen_llvm/src
parent1aa5b2246560ce85b42fa8b33e5927c5de3fa389 (diff)
downloadrust-63e1074c97b60d248f86321f021871f93ba10c31.tar.gz
rust-63e1074c97b60d248f86321f021871f93ba10c31.zip
Update AMDGPU data layout
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 6a23becaa96..34bed2a1d2a 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -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.