Skip to content

Commit ef00680

Browse files
committed
rustc_codegen_llvm: Simplify avx10.2 conversion
The original two match clauses represented `if` and `else` cases. This commit replaces them into a single match clause with `bool::then()`.
1 parent ee8a6b7 commit ef00680

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
308308
}
309309
("x86", "movrs") if get_version().0 < 20 => None,
310310
("x86", "avx10.1") => Some(LLVMFeature::new("avx10.1-512")),
311-
("x86", "avx10.2") if get_version().0 < 20 => None,
312-
("x86", "avx10.2") if get_version().0 >= 20 => Some(LLVMFeature::new("avx10.2-512")),
311+
("x86", "avx10.2") => (get_version().0 >= 20).then(|| LLVMFeature::new("avx10.2-512")),
313312
("x86", "apxf") => Some(LLVMFeature::with_dependencies(
314313
"egpr",
315314
smallvec![

0 commit comments

Comments
 (0)