Repository navigation
Version loops around nested loops only for accesses inside them - #2364
Merged
Merged
Conversation
ctate
commented
Oct 27, 2026
Collaborator
- A loop whose nested loops access typed arrays no longer versions for accesses that run once per pass, so its nested loops and their own versions are emitted once.
- Spectral-norm's paired row sums: the worker program's LLVM text goes from 786 KB to 519 KB, and its native object builds 25% faster (986 -> 742 ms). Run time and bench:runtime are unchanged (every workload emits the same LLVM).
- Adds corpus typed-array-nested-loop-versions.
A typed-array loop version runs a checked copy and one or two fast copies of the loop, and each copy repeats every nested loop together with the nested loop's own version. A loop whose guard proves only accesses outside its nested loops, which run once per pass, now runs as written when a nested loop accesses typed arrays; the nested loops still version their own accesses. The loop versions as before when the guard proves the bounds of an access inside a nested loop, or, in a worker program, the ownership of an access inside a nested while loop, which never versions for ownership alone. Spectral-norm's paired row sums no longer copy their column loop for the row loop's two stores. The worker program's au and atu functions are 102 KB of LLVM text instead of 236 KB each, and the program 519 KB instead of 786 KB. Corpus typed-array-nested-loop-versions covers row loops that store past the end or at negative, fractional and NaN rows, views the nested loop writes, and a nested while loop.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.