Commit 15601b2
feat(jit-report): attribute cost-model declines to the actual function at runtime (item #2)
The report's per-function "declined by cost model" verdict re-derived the
profitability from a bare re-translation, which loses profile-guided PICs (no
profile feedback at report time) — so the very case that most often stays
interpreted was not attributed.
Now `consult_profitability` takes the function name and records it in a new
`unprofitable_declined_fns` map (fn name → first decline reason) as the run
happens — ground truth. The report reads that map for the per-function verdict
instead of re-deriving, so a profile-guided PIC decline is now correctly
attributed to its function. `report` mode's per-region log line also gains the
`fn=...` tag, and the map is exposed in `to_json`.
Test: report_explains_cost_model_decline_for_polymorphic_pic now additionally
asserts the per-function `not native: declined by cost model` line (previously
only the summary block was reliable).
Verified: clippy 0; lib 276/0; runtime 453/0 (incl. all 11 report tests);
differential 33/0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent fa5b94f commit 15601b2
3 files changed
Lines changed: 48 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2434 | 2434 | | |
2435 | 2435 | | |
2436 | 2436 | | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
2437 | 2442 | | |
2438 | 2443 | | |
2439 | 2444 | | |
| |||
2551 | 2556 | | |
2552 | 2557 | | |
2553 | 2558 | | |
| 2559 | + | |
2554 | 2560 | | |
2555 | 2561 | | |
2556 | 2562 | | |
| |||
2589 | 2595 | | |
2590 | 2596 | | |
2591 | 2597 | | |
2592 | | - | |
| 2598 | + | |
2593 | 2599 | | |
2594 | 2600 | | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
2595 | 2609 | | |
2596 | | - | |
2597 | | - | |
2598 | | - | |
2599 | | - | |
2600 | | - | |
2601 | | - | |
2602 | | - | |
2603 | | - | |
2604 | | - | |
2605 | | - | |
2606 | | - | |
2607 | | - | |
2608 | | - | |
2609 | | - | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
2610 | 2615 | | |
2611 | 2616 | | |
2612 | 2617 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| 165 | + | |
165 | 166 | | |
166 | 167 | | |
167 | 168 | | |
| |||
170 | 171 | | |
171 | 172 | | |
172 | 173 | | |
173 | | - | |
| 174 | + | |
174 | 175 | | |
175 | 176 | | |
176 | 177 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
185 | 194 | | |
186 | 195 | | |
187 | 196 | | |
| |||
996 | 1005 | | |
997 | 1006 | | |
998 | 1007 | | |
999 | | - | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
1000 | 1015 | | |
1001 | 1016 | | |
1002 | 1017 | | |
| |||
1756 | 1771 | | |
1757 | 1772 | | |
1758 | 1773 | | |
1759 | | - | |
| 1774 | + | |
1760 | 1775 | | |
1761 | 1776 | | |
1762 | 1777 | | |
| |||
2140 | 2155 | | |
2141 | 2156 | | |
2142 | 2157 | | |
2143 | | - | |
| 2158 | + | |
2144 | 2159 | | |
2145 | 2160 | | |
2146 | 2161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4574 | 4574 | | |
4575 | 4575 | | |
4576 | 4576 | | |
4577 | | - | |
4578 | | - | |
4579 | | - | |
4580 | | - | |
| 4577 | + | |
| 4578 | + | |
4581 | 4579 | | |
4582 | 4580 | | |
4583 | 4581 | | |
4584 | 4582 | | |
4585 | 4583 | | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
4586 | 4591 | | |
4587 | 4592 | | |
4588 | 4593 | | |
| |||
0 commit comments