Skip to content

Commit 6c91efd

Browse files
authored
Rollup merge of #108205 - tshepang:why-special-case, r=cjgillot
link to llvm changes that prompted the special cases
2 parents 5d5e0b0 + 8ab795e commit 6c91efd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_codegen_llvm/src/context.rs

+5
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,13 @@ pub unsafe fn create_module<'ll>(
145145
let llvm_version = llvm_util::get_version();
146146
if llvm_version < (16, 0, 0) {
147147
if sess.target.arch == "s390x" {
148+
// LLVM 16 data layout changed to always set 64-bit vector alignment,
149+
// which is conditional in earlier LLVM versions.
150+
// https://reviews.llvm.org/D131158 for the discussion.
148151
target_data_layout = target_data_layout.replace("-v128:64", "");
149152
} else if sess.target.arch == "riscv64" {
153+
// LLVM 16 introduced this change so as to produce more efficient code.
154+
// See https://reviews.llvm.org/D116735 for the discussion.
150155
target_data_layout = target_data_layout.replace("-n32:64-", "-n64-");
151156
}
152157
}

0 commit comments

Comments
 (0)