diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-18 13:26:48 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-18 13:26:48 +0100 |
| commit | 6c91efd6d7806082f646d22eb3fd6736df82f9be (patch) | |
| tree | 5f3a983c91d8db87950f03bf08adbdc4050cd720 /compiler/rustc_codegen_llvm/src | |
| parent | 5d5e0b0fae05bc940af0193f9ef6192f796980a0 (diff) | |
| parent | 8ab795ef0834e28f6c8aee85a30486c09cd2bc35 (diff) | |
| download | rust-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/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/context.rs | 5 |
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-"); } } |
