File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -273,9 +273,14 @@ fn build_isa(sess: &Session, backend_config: &BackendConfig) -> Box<dyn isa::Tar
273
273
274
274
let variant = cranelift_codegen:: isa:: BackendVariant :: MachInst ;
275
275
let mut isa_builder = cranelift_codegen:: isa:: lookup_variant ( target_triple, variant) . unwrap ( ) ;
276
- // Don't use "haswell", as it implies `has_lzcnt`.macOS CI is still at Ivy Bridge EP, so `lzcnt`
277
- // is interpreted as `bsr`.
278
- isa_builder. enable ( "nehalem" ) . unwrap ( ) ;
276
+
277
+ if let Some ( target_cpu) = sess. opts . cg . target_cpu . as_ref ( ) {
278
+ isa_builder. enable ( target_cpu) . unwrap ( ) ;
279
+ } else {
280
+ // Don't use "haswell" as the default, as it implies `has_lzcnt`.
281
+ // macOS CI is still at Ivy Bridge EP, so `lzcnt` is interpreted as `bsr`.
282
+ isa_builder. enable ( "nehalem" ) . unwrap ( ) ;
283
+ }
279
284
isa_builder. finish ( flags)
280
285
}
281
286
You can’t perform that action at this time.
0 commit comments