mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-31 07:23:06 +08:00
An optimized program divided into partitions was simplified at O2 before the thin link and optimized again at O2 after importing, so the work on each partition's largest functions ran twice. The pre-link now runs the O1 simplification, which still annotates the profile and inlines and simplifies enough for the summaries the import decisions read; the backend's O2 optimization is unchanged. A program optimized as one module is unchanged. The O1 simplification has no correlated value propagation. Without it, SimplifyCFG folds a jammed loop's early exit and its trip-count exit into one branch, the loop's latch no longer exits, and the backend's unroller keeps a trip-count test in every unrolled iteration. The pre-link runs the pass once per function after simplifying it.