summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorWANG Rui <wangrui@loongson.cn>2025-04-29 22:12:27 +0800
committerWANG Rui <wangrui@loongson.cn>2025-04-29 22:12:27 +0800
commita2b3f11700821d778d4dfbc3651a61a0f0f6f3be (patch)
tree3d26d079426cb4e2ff22400d99208c5540897a4c /compiler/rustc_codegen_llvm/src
parentefcbb94dccbe0fcc1076f031f88332db4a6a2a52 (diff)
downloadrust-a2b3f11700821d778d4dfbc3651a61a0f0f6f3be.tar.gz
rust-a2b3f11700821d778d4dfbc3651a61a0f0f6f3be.zip
Filter out LoongArch features not supported by the current LLVM version
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-rw-r--r--compiler/rustc_codegen_llvm/src/llvm_util.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/llvm_util.rs b/compiler/rustc_codegen_llvm/src/llvm_util.rs
index ae1bdac1655..c17b99f1946 100644
--- a/compiler/rustc_codegen_llvm/src/llvm_util.rs
+++ b/compiler/rustc_codegen_llvm/src/llvm_util.rs
@@ -273,6 +273,12 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
         ("aarch64", "fpmr") => None, // only existed in 18
         ("arm", "fp16") => Some(LLVMFeature::new("fullfp16")),
         // Filter out features that are not supported by the current LLVM version
+        ("loongarch64", "div32" | "lam-bh" | "lamcas" | "ld-seq-sa" | "scq")
+            if get_version().0 < 20 =>
+        {
+            None
+        }
+        // Filter out features that are not supported by the current LLVM version
         ("riscv32" | "riscv64", "zacas") if get_version().0 < 20 => None,
         // Enable the evex512 target feature if an avx512 target feature is enabled.
         ("x86", s) if s.starts_with("avx512") => {