Skip to content

Version loops around nested loops only for accesses inside them - #2364

Merged
ctate merged 1 commit into
mainfrom
ctate/version-loops-around-d14165
Oct 27, 2026
Merged

ctate merged 1 commit into
mainfrom
ctate/version-loops-around-d14165

Conversation

@ctate

@ctate ctate commented Oct 27, 2026

Copy link
Copy Markdown
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.
@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scriptc Ready Ready Preview, v0 Oct 27, 2026 12:06am UTC

@ctate
ctate merged commit 2c5b3b4 into main Oct 27, 2026
65 of 67 checks passed
@ctate
ctate deleted the ctate/version-loops-around-d14165 branch October 27, 2026 00:35

This branch was successfully deployed

1 active deployment
Preview — ca1a6b5b Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant