Skip to content
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e881cb3
consolidate should inline check into single filter
vezenovm Sep 4, 2025
011672d
cleanup
vezenovm Sep 4, 2025
7e96ca5
unused improt
vezenovm Sep 4, 2025
034df33
skip acir func in weight calc
vezenovm Sep 4, 2025
e06d41f
cliipy
vezenovm Sep 4, 2025
9541e6a
Merge branch 'mv/consolidate-inline-check' into mv/skip-weight-calc-f…
vezenovm Sep 4, 2025
8ef6020
fmt
vezenovm Sep 4, 2025
3149043
Merge branch 'mv/consolidate-inline-check' into mv/skip-weight-calc-f…
vezenovm Sep 4, 2025
5a72f53
Merge branch 'master' into mv/consolidate-inline-check
vezenovm Sep 4, 2025
d43c7a0
inline if acir
vezenovm Sep 4, 2025
2442125
Merge remote-tracking branch 'origin/mv/consolidate-inline-check' int…
vezenovm Sep 4, 2025
489bd51
check brillig entry points whne inlining simple functions
vezenovm Sep 4, 2025
e20c251
fix self recursion at top-level breakage
vezenovm Sep 5, 2025
42d51d1
snaps
vezenovm Sep 5, 2025
ef78ce6
acir entry points inlining simple functions fix
vezenovm Sep 5, 2025
4ce146b
snaps and tests
vezenovm Sep 5, 2025
03eb506
Merge branch 'master' into mv/consolidate-inline-check
vezenovm Sep 5, 2025
18c9b29
Merge branch 'mv/consolidate-inline-check' into mv/skip-weight-calc-f…
vezenovm Sep 5, 2025
6a8d4f9
fixup recursive_functions_non_inline_target assertion
vezenovm Sep 5, 2025
d56d787
snaps
vezenovm Sep 5, 2025
9ffab47
Merge branch 'mv/consolidate-inline-check' into mv/skip-weight-calc-f…
vezenovm Sep 5, 2025
064a752
skip weight calc for recursive Brillig funcitons as well
vezenovm Sep 5, 2025
dbe4518
missed some snaps
vezenovm Sep 5, 2025
4dc8acf
Merge branch 'mv/consolidate-inline-check' into mv/skip-weight-calc-f…
vezenovm Sep 5, 2025
db82b79
Merge branch 'master' into mv/skip-weight-calc-for-acir-funcs
vezenovm Sep 5, 2025
ce66760
snaps
vezenovm Sep 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions compiler/noirc_evaluator/src/ssa/opt/inlining/inline_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,19 @@ fn compute_function_should_be_inlined(
}

let function = &ssa.functions[&func_id];
let runtime = function.runtime();

if runtime.is_acir() {
let info = inline_infos.entry(func_id).or_default();
info.should_inline = true;
return;
}

let is_recursive = inline_infos.get(&func_id).is_some_and(|info| info.is_recursive);
if runtime.is_brillig() && is_recursive {
return;
}

let assert_constant_id = function.dfg.get_intrinsic(Intrinsic::AssertConstant).copied();
let static_assert_id = function.dfg.get_intrinsic(Intrinsic::StaticAssert).copied();

Expand Down Expand Up @@ -197,17 +210,12 @@ fn compute_function_should_be_inlined(
let inline_cost = times.saturating_mul(total_weight);
let retain_cost = times.saturating_mul(interface_cost) + total_weight;
let net_cost = inline_cost.saturating_sub(retain_cost);
let runtime = function.runtime();
let info = inline_infos.entry(func_id).or_default();

info.contains_static_assertion = contains_static_assertion;
info.weight = total_weight;
info.cost = net_cost;

if runtime.is_brillig() && info.is_recursive {
return;
}

let should_inline = (net_cost < aggressiveness)
|| runtime.is_inline_always()
|| (runtime.is_no_predicates() && inline_no_predicates_functions)
Expand Down
Loading