Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

link to llvm changes that prompted the special cases #108205

Merged
merged 2 commits into from
Feb 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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