Skip to content

Commit

Permalink
fix(ssa refactor): Fix failed_to_inline_a_function being set for intr…
Browse files Browse the repository at this point in the history
…insics (#1675)

Fix failed_to_inline_a_function being set for intrinsics
  • Loading branch information
jfecher authored Jun 14, 2023
1 parent dbd6db8 commit 377ac5c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/noirc_evaluator/src/ssa_refactor/opt/inlining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,14 @@ impl<'function> PerFunctionContext<'function> {
id = self.translate_value(id);
match self.context.builder[id] {
Value::Function(id) => Some(id),
// We don't set failed_to_inline_a_call for intrinsics since those
// don't correspond to actual functions in the SSA program that would
// need to be removed afterward.
Value::Intrinsic(_) => None,
_ => None,
_ => {
self.context.failed_to_inline_a_call = true;
None
},
}
}

Expand Down Expand Up @@ -332,10 +338,7 @@ impl<'function> PerFunctionContext<'function> {
self.push_instruction(*id);
}
},
None => {
self.context.failed_to_inline_a_call = true;
self.push_instruction(*id);
}
None => self.push_instruction(*id),
},
_ => self.push_instruction(*id),
}
Expand Down

0 comments on commit 377ac5c

Please sign in to comment.