Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b1bd3de969
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let analysis = module_analysis::analyze_module(module); | ||
| let mut inlinee_summaries: FxHashMap<FuncRef, cost::InlineeSummary> = | ||
| FxHashMap::default(); | ||
| let mut growth_by_caller: FxHashMap<FuncRef, usize> = FxHashMap::default(); |
There was a problem hiding this comment.
Keep caller growth budget across fixed-point iterations
growth_by_caller is reinitialized inside the outer while loop, so max_growth_per_caller is enforced only within a single sweep of callsites. If one iteration inlines a callee that exposes additional calls in the same caller, the next iteration starts that caller back at zero and can inline past the configured per-caller cap, which defeats the intended code-growth guardrail for multi-iteration inlining.
Useful? React with 👍 / 👎.
| return InlineDecision::Skip(InlineSkipReason::NoBody); | ||
| } | ||
|
|
||
| let predicted_growth = summary.insts.saturating_sub(1); |
There was a problem hiding this comment.
Include synthesized merge phi in growth prediction
The budget gate uses predicted_growth = summary.insts - 1, but full inlining can insert an extra merge phi when a multi-return callee's result is used (full.rs increments inserted_insts for that case). This makes the pre-inline budget check optimistic, so max_growth_per_caller and max_total_growth can be exceeded by one per such inline even though the decision path said the site was within budget.
Useful? React with 👍 / 👎.
No description provided.