llvm: Match new LLVM 128-bit integer alignment on sparc

LLVM continues to align more 128-bit integers to 128-bits in the data
layout rather than relying on the high level language to do it. Update
SPARC target files to match and add a backcompat replacement for current
LLVMs.

See llvm/llvm-project#106951 for details
This commit is contained in:
Matthew Maurer 2024-10-31 20:35:24 +00:00
parent a0d98ff0e5
commit 9caced7bad
7 changed files with 11 additions and 6 deletions

View file

@ -148,6 +148,11 @@ pub(crate) unsafe fn create_module<'ll>(
target_data_layout =
target_data_layout.replace("-p270:32:32-p271:32:32-p272:64:64", "");
}
if sess.target.arch.starts_with("sparc") {
// LLVM 20 updates the sparc layout to correctly align 128 bit integers to 128 bit.
// See https://github.com/llvm/llvm-project/pull/106951
target_data_layout = target_data_layout.replace("-i128:128", "");
}
}
// Ensure the data-layout values hardcoded remain the defaults.