Skip to content

Commit

Permalink
Rollup merge of rust-lang#108205 - tshepang:why-special-case, r=cjgillot
Browse files Browse the repository at this point in the history
link to llvm changes that prompted the special cases
  • Loading branch information
matthiaskrgr committed Feb 18, 2023
2 parents 5d5e0b0 + 8ab795e commit 6c91efd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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-");
}
}
Expand Down

0 comments on commit 6c91efd

Please sign in to comment.