mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
A speculative integer loop's fast copy exits to a copy that resumes the failed iteration, and both read the header fields of the views they access. GVN's load PRE moved the fast copy's read of a view's data pointer ahead of the exit branch, to make the resume copy's read redundant, and put a copy on the exit edge. The loop then kept its first iteration in the loop, so the overflow checks of a value whose range is known after one iteration stayed in every iteration, with a reload of the data pointer. A view held by a const local or a parameter that the loop does not rebind is the same view in every iteration, and its length, data pointer and shared storage never change. The loop's entry now reads them once, and the element accesses of every copy use those values.