about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-02-16 00:51:24 -0500
committerGitHub <noreply@github.com>2025-02-16 00:51:24 -0500
commitd3556c6644dfa1d323c6b19a7c1b36e4de932433 (patch)
tree4ca110a73dc380c1a4e4ab7dbceeb978ee6fb7ce /compiler/rustc_codegen_llvm/src
parent20004d4bdd787b3e3b664827acafdd6c2ebfbce3 (diff)
parente9cb36bd0f86bc79587ecf840ff6b2fa7cc94d17 (diff)
downloadrust-d3556c6644dfa1d323c6b19a7c1b36e4de932433.tar.gz
rust-d3556c6644dfa1d323c6b19a7c1b36e4de932433.zip
Rollup merge of #136545 - durin42:nvptx64-align, r=nikic
nvptx64: update default alignment to match LLVM 21

This changed in llvm/llvm-project@91cb8f5d3202870602c6bef807bc4c7ae8a32790. The commit itself is mostly about some intrinsic instructions, but as an aside it also mentions something about addrspace for tensor memory, which I believe is what this string is telling us.

`@rustbot` label: +llvm-main
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index 7fe527a4c07..e7952bc95e7 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -194,6 +194,12 @@ pub(crate) unsafe fn create_module<'ll>(
             target_data_layout = target_data_layout.replace("-i128:128", "");
         }
     }
+    if llvm_version < (21, 0, 0) {
+        if sess.target.arch == "nvptx64" {
+            // 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");
+        }
+    }
 
     // Ensure the data-layout values hardcoded remain the defaults.
     {