Skip to content

Commit 1f95f4d

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 5244760 commit 1f95f4d

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
@@ -305,8 +305,7 @@ pub(crate) fn to_llvm_features<'a>(sess: &Session, s: &'a str) -> Option<LLVMFea
305305
}
306306
("x86", "movrs") if major < 20 => None,
307307
("x86", "avx10.1") => Some(LLVMFeature::new("avx10.1-512")),
308-
("x86", "avx10.2") if major < 20 => None,
309-
("x86", "avx10.2") if major >= 20 => Some(LLVMFeature::new("avx10.2-512")),
308+
("x86", "avx10.2") => (major >= 20).then(|| LLVMFeature::new("avx10.2-512")),
310309
("x86", "apxf") => Some(LLVMFeature::with_dependencies(
311310
"egpr",
312311
smallvec![

0 commit comments

Comments
 (0)