Skip to content

Optimizer: add global value, loop, range, and effect-aware optimization #469

Description

@chrisbbreuer

Parent: #459
Depends on: #467, #461

Goal

Implement backend-neutral global optimizations over the optimizer IR: redundant work elimination, loop optimization, range reasoning, and guard/bounds-check reduction.

Scope

  • Global value numbering/CSE, copy propagation, sparse conditional constant propagation, dead-code elimination, and effect-aware load/store forwarding.
  • Dominator-based loop-invariant code motion, induction-variable recognition, strength reduction, loop rotation/unswitching where profitable, and invariant guard hoisting.
  • Integer/range/length analysis for overflow-aware arithmetic, packed arrays, strings, typed arrays, and Wasm memory.
  • Redundant shape/prototype/tag/bounds/barrier elimination only when invalidation and memory-order proofs remain valid.
  • Block layout, branch probability, register-pressure, and code-size cost models.
  • Preserve exact bytecode-step/watchdog accounting even when emitted machine operations are removed or moved.

Effect model requirements

Calls, coercions, getters/setters, proxies, iterators, allocation/OOM, GC safepoints, debugger hooks, atomics, shared-memory accesses, and no-GIL mutations must be explicit barriers or modeled effects. Unknown does not mean pure.

Acceptance

Foundation

Optimizer CFG/SSA and reducible regions landed under #431 and #438, including a42aaf26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestjitBytecode, baseline JIT, optimizer, and code generationperformanceMeasured runtime, memory, scaling, or build performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions