1
Fork 0

Never MIR inline functions with a different instruction set

This commit is contained in:
Tomasz Miąsko 2021-02-05 00:00:00 +00:00
parent 9e5d58fb42
commit eb5e2d08c7
5 changed files with 152 additions and 1 deletions

View file

@ -281,6 +281,11 @@ impl Inliner<'tcx> {
return false;
}
if self.codegen_fn_attrs.instruction_set != codegen_fn_attrs.instruction_set {
debug!("`callee has incompatible instruction set - not inlining");
return false;
}
let hinted = match codegen_fn_attrs.inline {
// Just treat inline(always) as a hint for now,
// there are cases that prevent inlining that we