Cranelift: ensure ISA level needed for SIMD is present when SIMD is enabled. (#3816)

Addresses #3809: when we are asked to create a Cranelift backend with
shared flags that indicate support for SIMD, we should check that the
ISA level needed for our SIMD lowerings is present.
This commit is contained in:
Chris Fallin
2022-02-16 17:29:30 -08:00
committed by GitHub
parent ef17a36852
commit 1c014d129a
55 changed files with 172 additions and 84 deletions

View File

@@ -110,7 +110,7 @@ fn create_target_isa(isa_spec: &IsaSpec) -> Result<Box<dyn TargetIsa>> {
if let IsaSpec::None(flags) = isa_spec {
// build an ISA for the current machine
let builder = host_isa_builder().map_err(|s| anyhow::anyhow!("{}", s))?;
Ok(builder.finish(flags.clone()))
Ok(builder.finish(flags.clone())?)
} else {
anyhow::bail!(
"A target ISA was specified in the file but should not have been--only \

View File

@@ -99,7 +99,7 @@ pub fn parse_sets_and_triple(
.map_err(ParseError::from)?;
Ok(OwnedFlagsOrIsa::Isa(
isa_builder.finish(settings::Flags::new(flag_builder)),
isa_builder.finish(settings::Flags::new(flag_builder))?,
))
} else {
if !unknown_settings.is_empty() {