about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/llvm_util.rs
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2023-12-04 15:52:26 +0000
committerKrasimir Georgiev <krasimir@google.com>2023-12-08 13:06:07 +0000
commitb378059e6b2573c5356423fa31d184a89a3b6029 (patch)
treeb5a558051414b76d64202d867f74e004337111cd /compiler/rustc_codegen_llvm/src/llvm_util.rs
parent0a83e43f282353398e4b22466cf1f4e3cc8c1682 (diff)
downloadrust-b378059e6b2573c5356423fa31d184a89a3b6029.tar.gz
rust-b378059e6b2573c5356423fa31d184a89a3b6029.zip
update target feature following LLVM API change
LLVM commit https://github.com/llvm/llvm-project/commit/e81796671890b59c110f8e41adc7ca26f8484d20
renamed the `unaligned-scalar-mem` target feature to `fast-unaligned-access`.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/llvm_util.rs')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index eb69efb0d59..93cb7327a01 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -263,6 +263,10 @@ pub fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> LLVMFeature<'a> {
             "sve2-bitperm",
             TargetFeatureFoldStrength::EnableOnly("neon"),
         ),
+        // The unaligned-scalar-mem feature was renamed to fast-unaligned-access.
+        ("riscv32" | "riscv64", "fast-unaligned-access") if get_version().0 <= 17 => {
+            LLVMFeature::new("unaligned-scalar-mem")
+        }
         (_, s) => LLVMFeature::new(s),
     }
 }