Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions changelog.d/8894-tre-alloca-walk-budget.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- `PERRY_LL_TRE_MAX_ALLOCA_WALK` (default 2^26, #8883): before the optimization pipeline runs, a function whose `allocas × instructions` exceeds the budget is stamped `"disable-tail-calls"="true"`, the switch `TailCallElim` itself honours. LLVM's `markTails` walks the transitive SSA uses of every alloca and only loads, stores and `nocapture` arguments stop it; on a statepoint-rewritten body an alloca handed to any runtime call reaches the statepoint token, its `gc.relocate`s and, through their `gc-live` bundles, every later statepoint, so each walk covers the whole function and the pass is quadratic. Coop's Next.js route (jsonwebtoken's bundled entry: 400 allocas, 643k post-RS4GC instructions, 477k relocates, ~1.6M visited uses per alloca) held one LLVM worker for the better part of two CPU-hours in that walk on a unit whose remaining `-Os` passes take 16 s. The stamped function still runs every other pass at the requested level (#8421's contract); it gives up exactly tail-recursion-to-loop and sibling-call codegen, and it is never `optnone` (#8583). The trip is logged with the function's name, alloca and instruction counts; `<n>` raises or lowers the cap, `0`/`off` disables it; both caches key on it.
Loading
Loading