-
-
Notifications
You must be signed in to change notification settings - Fork 158
fix(codegen): delete the unsound pre-RS4GC optnone knob; add a post-rewrite instruction budget and per-unit codegen stats (#8583) #8586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,5 @@ | ||||||
| ### Changed | ||||||
|
|
||||||
| - `PERRY_LL_PREOPT_OPTNONE_INSTRS` is removed (#8583). It stamped `optnone` before `rewrite-statepoints-for-gc`, which makes the pass manager skip `mem2reg`/`sccp` while RS4GC still runs, so a demoted function's root allocas were never promoted and the collector never saw them. The cap defaulted to 0, so no shipped build was affected; a test now pins that an `optnone` function loses every root under the rewrite. | ||||||
| - `PERRY_LL_RS4GC_MAX_INSTRS` (default 1.5 Mi): after `rewrite-statepoints-for-gc`, a function whose body exceeds the per-function budget fails its codegen unit with the function's name and its sizes before and after the rewrite, instead of entering an optimizer pipeline that is super-linear on statepoint relocation fan-out and would not finish. This is an assertion, not a fallback — no function is ever demoted and the requested optimization level applies to every function. `<n>` raises it, `warn:<n>` only warns, `0` disables. Both caches key on it. | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win Use an exact instruction count for the default.
Proposed wording-- `PERRY_LL_RS4GC_MAX_INSTRS` (default 1.5 Mi):
+- `PERRY_LL_RS4GC_MAX_INSTRS` (default 1,500,000 instructions):📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| - `PERRY_CODEGEN_UNIT_TIMINGS` now reports, per codegen unit, the widest function by estimated IR before LLVM starts, and after compile the instruction totals and widest function before and after RS4GC, the growth factor, and rewrite/optimize/emit times. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Describe the shipped RS4GC behavior instead of the test implementation.
a test now pinsis development detail, not release-note behavior. The test shows that root allocas remain unpromoted and hidden from RS4GC; it does not show that roots are deleted.Proposed wording
Based on learnings: “For PerryTS/perry changelog fragments in changelog.d/, describe the final shipped behavior as one coherent release-note entry. Do not include separate development-slice narratives that may contradict one another when the release notes are assembled.”
📝 Committable suggestion
🤖 Prompt for AI Agents
Source: Learnings