mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-18 22:51:21 +00:00
llvm_21: backport patch for selectiondag freeze condition miscompile
Several LLVM versions have a bug in SelectionDAG that causes miscompilations around conditional poisions. This was exposed due to Rust 1.97.0 exercising the involved code path heavily and generating segfaulting code, but the bug existed beforehand as well. The patch was made to LLVM 23, but the tests have many conflicts, so this is a manual backport. This backport was made by: - applying the code change to `llvm/lib` - hand-updating `test/CodeGen/Mips/cmov.ll` with the same diff as the PR - updating the rest with `utils/update_llc_test_checks.py` from the LLVM source tree, and verifying the diff against the one in the PR. The last step made this a rather large and gnarly patch, but it's mostly mechanical. Rust issue: https://github.com/rust-lang/rust/issues/159035 LLVM issue: https://github.com/llvm/llvm-project/issues/208611 LLVM PR: https://github.com/llvm/llvm-project/pull/208683
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -222,7 +222,19 @@ stdenv.mkDerivation (
|
||||
hash = "sha256-3hkbYPUVRAtWpo5qBmc2jLZLivURMx8T0GQomvNZesc=";
|
||||
stripLen = 1;
|
||||
}
|
||||
);
|
||||
)
|
||||
++ lib.optionals (lib.versions.major release_version == "21") [
|
||||
# Several LLVM versions have a bug in SelectionDAG that causes
|
||||
# miscompilations around conditional poisions. This was exposed due to
|
||||
# Rust 1.97.0 exercising the involved code path heavily and generating
|
||||
# segfaulting code. The patch was made to LLVM 23, but the tests have
|
||||
# many conflicts, so we vendor a version-specific modified version.
|
||||
#
|
||||
# Rust issue: https://github.com/rust-lang/rust/issues/159035
|
||||
# LLVM issue: https://github.com/llvm/llvm-project/issues/208611
|
||||
# LLVM PR: https://github.com/llvm/llvm-project/pull/208683
|
||||
(getVersionFile "llvm/sdag-freeze-condition-in-select-of-load-fold.patch")
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
|
||||
Reference in New Issue
Block a user