Commits

trunk
Switch branches/tags
All users
Until Apr 9, 2026
April 2026
Su Mo Tu We Th Fr Sa
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 1 2
3 4 5 6 7 8 9

Commits on April 9, 2026

  1. mfwolffe committed
  2. mfwolffe committed
  3. mfwolffe committed
  4. mfwolffe committed
  5. mfwolffe committed
  6. mfwolffe committed
  7. mfwolffe committed
  8. mfwolffe committed
  9. re-enable SROA after Mem2Reg+ConstFold (GCC SRA pattern): 117 e2e pass
    SROA runs after SSA construction and constant folding, matching
    GCC's pass ordering. Second Mem2Reg promotes SROA-created scalar
    allocas. Placed before inlining so contained functions also benefit.
    
    Active O2 pipeline now has SROA + GVN enabled (21 passes).
    GlobalLsf remains disabled (path-sensitivity bug).
    mfwolffe committed
  10. re-enable GVN (after loop passes), fix GlobalLsf load-block clobber check, keep GlobalLsf disabled
    GVN placed after all loop passes avoids unswitching SSA conflicts.
    117 e2e programs pass with GVN enabled.
    
    GlobalLsf: added load-block clobber check (calls before load prevent
    cross-block forwarding). Still has path-sensitivity bug: forwards
    past calls on non-dominator paths (fibonacci loop bound mismatch).
    Needs proper MemorySSA-style walk (every path from store to load
    must be clobber-free). Disabled pending proper implementation.
    mfwolffe committed
  11. disable 29.8 passes from pipeline: SROA/GVN/GlobalLsf have interaction bugs
    SROA + second Mem2Reg triggers unswitching SSA errors on nested loops.
    GlobalLsf incorrectly forwards stores across calls that clobber memory.
    GVN alone works but combined pipeline is unstable.
    
    The pass implementations exist and their unit tests pass, but they
    cannot safely run in the O2+ pipeline yet. Fix: SROA byte-GEP
    rejection added (ptr<i8> GEPs from array constructors).
    
    Deferred to 29.8.5: study GCC/LLVM .refs for proper SROA placement
    and GlobalLsf clobber analysis. The code is correct in isolation;
    the pipeline ordering and interaction with existing passes needs work.
    mfwolffe committed
  12. add bounds check elimination framework: CheckBounds RuntimeFunc + BCE pass
    Adds RuntimeFunc::CheckBounds for array bounds checking. BCE pass
    removes CheckBounds calls when the index is provably in-bounds
    (constant index in [lower, upper], or loop IV within loop bounds).
    
    Bounds check INSERTION (adding CheckBounds at array access sites
    in the lowerer) is deferred — this sprint delivers the elimination
    framework. Unit tests verify constant-index elimination works.
    mfwolffe committed
  13. add SROA pass: decompose small aggregate allocas into individual scalars
    Detects alloca [T x N] where N≤8 with constant-index GEPs and no
    address escape. Creates N individual alloca T, rewrites GEP users.
    Combined with second Mem2Reg pass, enables full scalar promotion
    of small arrays and complex numbers.
    mfwolffe committed
  14. fix critical multi-site inline SSA bug: revert to one-at-a-time with re-scan
    Two calls to the same function in one block broke SSA: the second
    inline split a block already modified by the first, leaving stale
    ValueId references. Reverted to safe one-at-a-time approach with
    pass manager fixpoint re-invocation.
    
    Also: removed unused preds variable and dead || true in SimplifyCFG.
    Added inline_multisite.f90 regression test (3 calls to helper in
    one block).
    mfwolffe committed
  15. add function inlining pass with call graph, cost model, and Internal ref codegen fix
    Inlining clones callee blocks into caller, maps params to args,
    replaces Return with Branch to post-call block. Cost model: O1 ≤20
    insts (PURE only), O2 ≤100, O3 ≤200. Non-recursive only.
    
    Also fixed codegen to resolve FuncRef::Internal(idx) to actual
    function names via select_module name table (was emitting _func_N
    placeholder). All 866 unit tests + all test programs O0==O2.
    mfwolffe committed
  16. rewrite fission/fusion CFG surgery, re-enable in pipeline
    Fission: clone loop, remove store from each copy (LLVM-inspired).
    Fusion: latch-redirect pattern — clone gap block constants into B's
    body, redirect A's body exit → B's body → B's latch → A's latch.
    Remap iv_b → iv_a. Exit block content copying.
    
    Guards: skip loops with inner loops, skip fission-produced clones.
    Dep analysis: fusion_legal now remaps IVs so same-iteration RAW deps
    are correctly recognized as fusion-legal.
    
    All 12 stress/loop tests pass O0==O2. 859 unit tests pass.
    mfwolffe committed