about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-18 13:26:48 +0100
committerGitHub <noreply@github.com>2023-02-18 13:26:48 +0100
commit6c91efd6d7806082f646d22eb3fd6736df82f9be (patch)
tree5f3a983c91d8db87950f03bf08adbdc4050cd720 /compiler/rustc_codegen_llvm
parent5d5e0b0fae05bc940af0193f9ef6192f796980a0 (diff)
parent8ab795ef0834e28f6c8aee85a30486c09cd2bc35 (diff)
downloadrust-6c91efd6d7806082f646d22eb3fd6736df82f9be.tar.gz
rust-6c91efd6d7806082f646d22eb3fd6736df82f9be.zip
Rollup merge of #108205 - tshepang:why-special-case, r=cjgillot
link to llvm changes that prompted the special cases
Diffstat (limited to 'compiler/rustc_codegen_llvm')
-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 8848ea3bb9a..37ee0e14020 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -145,8 +145,13 @@ pub unsafe fn create_module<'ll>(
     let llvm_version = llvm_util::get_version();
     if llvm_version < (16, 0, 0) {
         if sess.target.arch == "s390x" {
+            // LLVM 16 data layout changed to always set 64-bit vector alignment,
+            // which is conditional in earlier LLVM versions.
+            // https://reviews.llvm.org/D131158 for the discussion.
             target_data_layout = target_data_layout.replace("-v128:64", "");
         } else if sess.target.arch == "riscv64" {
+            // LLVM 16 introduced this change so as to produce more efficient code.
+            // See https://reviews.llvm.org/D116735 for the discussion.
             target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
         }
     }