You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Spill-range trimming introduces stack traffic in call-free loops #271
This produces an unnecessary accumulator store on every loop iteration, in addition to a save immediately before the helper call. A second variant, where the accumulator controls loop termination and the helper is called afterward, produces both a store and a reload on every iteration.
Tracing these cases shows one split near the helper call. Trimming then moves the end of the live ranges back into the loop, introducing repeated stack traffic.
I’m not an expert on this code, but I’ve investigated it with GPT-6 Astra. Two possible improvements seem worth discussing:
Stop trimming when it would enter a deeper loop than the split point, to avoid turning preservation outside a loop into per-iteration traffic.
Account for block-argument uses and block-parameter definitions during trimming, rather than consulting only the instruction-use lists.
A small patch implementing the loop-depth restriction fixes both examples (and I'll post that PR soon). I had Astra prototype accounting for block-argument uses, and it also fixes this issue, though it requires more substantial work.
Related to #268/#270 in symptom, but these reproductions do not trigger the split-limit fallback. Neither approach removes the inner-loop spills in #268’s attached reproducer.
Activity