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:
@@ -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 \
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user