mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-24 06:14:01 +08:00
LLVM's WebAssembly pass that gives multiple-entry loops a single entry first records, for every block, every block it can reach. Its time and memory grow with the square of a function's block count even when the function has no such loop. In the three.js nodes fixture a module initializer of 40,000 blocks spent four minutes and 22 GB in it, which set the helper's peak and most of its wall time. The helper now runs the pass only on functions whose control flow graph is irreducible, and WebAssembly object emission leaves out the module pass that collects external symbols for assembly declarations, so each function's machine code is freed once it is printed. Optimized partitions are compiled through the thin backend's pre-codegen hook to use the same pipeline. Objects are unchanged.