270 Commits (d6f42a2a2efc79ec631546293c5752d1cbd1cf92)
 

Author SHA1 Message Date
lzkk d6f42a2a2e fix(mir): 回退到稳定版本——PhysReg映射+spill reload+别名无条件冲突
3 days ago
lzkk 0f1b545568 fix(mir): 分配顺序改为FirstUsePos + 别名无条件冲突 + per-round reserve
3 days ago
lzkk 83228a8123 fix(mir): GPR32/GPR64别名检查移除segments.empty()条件
3 days ago
lzkk 5fb106bde8 fix(mir): LLVM两遍分配 + 间隙分裂 + Assign安全网
4 days ago
lzkk 508f9d8ddc fix(mir): TrySplit引用失效修复 + LLVM Defer机制
4 days ago
lzkk 80dc583143 fix(mir): PhysReg映射修正 + spill reload分配独立vreg——避免寄存器冲突
4 days ago
lzkk ddaf8831a2 fix(mir): CMakeLists.txt 改用 GreedyAlloc.cpp 替代 LinearScanAlloc.cpp
4 days ago
lzkk da1e456133 feat(mir): 实现 LLVM-style 贪婪寄存器分配器 —— 统一架构
4 days ago
lzkk 0a29e6ac42 fix(mir): AsmPrinter 函数调用后失效帧基址缓存——修复 92_register_alloc
4 days ago
lzkk 363b809736 fix(mir): 大栈帧 asm 输出 x13 缓存失效 + 叶函数栈参数偏移修复 + IR 数组初始化阈值降低
4 days ago
lzkk 120d7197d8 fix(mir): 线性扫描活变量分析 def 位置记录 + callee-saved 寄存器限定 + CLI 标志修复
4 days ago
lzkk e1777c9eab fix(ir): CSE 安全门禁——非 SSA 函数跳过 Load/GEP CSE
4 days ago
lzkk 28c336728d fix(mir): 线性扫描区间分裂修复 + 多定义点 vreg 跳过逻辑修复
4 days ago
lzkk fbea91986d feat(mir): 指令级活变量分析 + CLI/构建集成
4 days ago
lzkk 8f3012cd9f fix(ir): CSE 扩展支持 LoadInst 和 GEPInst——修复 86_long_code2 编译超时
4 days ago
lzkk 28ad162de4 feat(mir): 线性扫描寄存器分配初始实现(WIP,--regalloc=linear 可用)
4 days ago
lzkk a9ebfdc0e0 feat(mir): 添加指令级活变量分析——精确 [start,end] 区间
4 days ago
lzkk 6c5441ff43 feat(mir): 添加 MIR 验证器和寄存器分配验证器
4 days ago
lzkk fb77d7e03c chore(ir): 清理 IRVerifier 死代码和注释
4 days ago
lzkk 0b589c77da feat(ir): 添加 IR 验证器,校验 SSA 支配性/终结指令/PHI 一致性
4 days ago
lzkk ef6eedee83 fix(infra): count_asm.sh 使用相对路径替代硬编码路径
5 days ago
lzkk c12b6830b8 fix(regalloc): MAX_SPILL_ROUNDS=1 + 保守修复阈值 20→200,修复 spill 错误代码
5 days ago
lzkk ca6c9fa540 docs: 记录 MAX_SPILL_ROUNDS 修复——mm1 指令数削减 99.4%
5 days ago
lzkk d238777f17 fix(regalloc): 根除 spill 代码指数级膨胀——MAX_SPILL_ROUNDS 统一为 3
5 days ago
lzkk 535ab08d32 feat(backend): AsmPrinter 帧基址缓存,避免连续栈访问重复计算地址
5 days ago
lzkk 3ab88232f7 fix(hooks): Stop hook 改为智能检测——仅在 src/ 有未提交改动时提醒
5 days ago
lzkk 6f14ee1a7a fix(infra): 编译器资源限制包装器 + 测试脚本超时防护,防止 OOM 闪退
5 days ago
lzkk 5300e2c1ec fix(hooks): 修复会话崩溃 + 优化开发规范配置
5 days ago
lzkk da5d618297 fix(hooks): memory-guard 输出合法 JSON,修复会话崩溃
5 days ago
lzkk 2d3a5ff998 perf(backend): Peephole 新增全局变量 store-load 转发和 load CSE
5 days ago
lzkk b2b7210f11 perf(backend): 除法/取模统一使用 sdiv,删除2的幂次移位序列
5 days ago
lzkk befdca6451 perf(backend): 叶函数跳过帧设置,节省 x29/x30 保存/恢复
5 days ago
lzkk 854168fb4e perf(backend): 消除连续全局变量访问的冗余 ADRP
5 days ago
lzkk acdac5391d fix(backend): EmitLargeImmediate 跳过前导零,避免冗余 movz #0
5 days ago
lzkk bb58aac749 fix(mem2reg): 添加大参数函数安全门禁,修复 87_many_params
5 days ago
lzkk fccd935a24 feat(backend): 新增 AddImm/SubImm 操作码,消除冗余 MovImm
5 days ago
lzkk bd7dcedb2a feat(backend): ICmp 降级常量折叠到 CmpImm,消除冗余 MovImm
5 days ago
黄熙哲 6b9cf3a448 fix(backend): add x16/x17 to GP allocatable set to fix segfaults
6 days ago
黄熙哲 5902060dae fix(backend): lower coalesce skip threshold to fix segfaults
6 days ago
黄熙哲 34cb79449f fix(backend): skip coalescing for large functions to prevent segfault\n\nFor functions with >150 vregs, discard move_preferences after\ncollection to skip active coalescing. Large functions like\nconv2d, 65_color, 68_brainfk have complex interference graphs\nthat cause coalescing to generate incorrect spill code.\n\nFixes segfaults in: conv2d-1/2/3, 65_color, 68_brainfk, 37_dct.\n\nKnown limitations: 30_many_dimensions and 39_fp_params still\nsegfault (pre-existing original compiler bugs in lowering/RA).\nMinor instruction count changes: h-8 +2.5%, matmul +7% etc.
6 days ago
黄熙哲 a84ffd210b chore: simplify baseline to single-column historical minimum\n\nRemove source baseline concept. Each test now tracks only its\nbest-ever instruction count. count_asm.sh updated to directly\nupdate baseline when a new lower value is found.
7 days ago
黄熙哲 b7e78ebd56 fix(backend): AsmPrinter large frame + RegAlloc spill limit\n\nApply only proven-safe fixes on clean baseline:\n- AsmPrinter: movz/movk for large stack offsets (>12KB)\n 30_many_dimensions: 7M -> 1455 lines (99.9% reduction)\n- RegAlloc: limit spill rounds to 3 for large functions (>120 vregs)\n 39_fp_params: >120s -> <1s compilation\n\nZero instruction count regression confirmed.\n57/60 performance tests at historical best baseline.
7 days ago
黄熙哲 2e368f86cf chore: update instruction count baseline after Mem2Reg threshold tuning\n\nKey improvements from PHI threshold relaxation:\n- many_mat_cal: 523->432 (-91 lines, 17.4%)\n- h-8: 504->407 (-97 lines, 19.2%)\n- matmul: 450->366 (-84 lines, 18.7%)\n\nCrypto and other complex functions unaffected (correctly skipped).
1 week ago
黄熙哲 cc9f4f9a76 feat(mem2reg): tune PHI threshold to allow Mem2Reg on moderate functions\n\nChange phi_threshold from max(50, block_count) to max(100, block_count*2).\nThe old threshold was too conservative for functions with many allocas\nlike many_mat_cal (~15 allocas, 60 blocks), causing premature skip.\nThe new threshold allows these while still blocking crypto-like functions\nwhere excessive PHI nodes hurt code quality.\n\nmany_mat_cal: -91 lines, matmul: -84 lines, h-8: -97 lines
1 week ago
黄熙哲 d5d8924050 chore: update instruction count baseline after loop optimizations merge\n\nAdditional reductions from loop IR passes:\n- conv2d: 657->629 (-28), fft: 619->605 (-14)\n- huffman: 849->829 (-20), sl: 280->264 (-16)\n- knapsack: 175->167 (-8), transpose: 211->207 (-4)\n- 01_mm: 313->310 (-3), h-10: 335->329 (-6)\n\nRestore CLAUDE.md deleted during merge.
1 week ago
黄熙哲 06bada3ff5 Merge remote master into local master
1 week ago
黄熙哲 39b7e2ed19 feat(backend): loop-depth weighted spill cost model\n\nAdds DFS-based back-edge detection to compute basic block loop\nnesting depth. Each vreg inherits the max loop depth of its\ndefining blocks. Spill cost multiplies interval+ref by 10^depth,\nmaking loop-carried variables much more expensive to spill.
1 week ago
黄熙哲 993e81363a fix(backend): recompute degree unconditionally after MergeInto\n\nAfter a merge, u inherits v's neighbors, so degree[u] must always\nbe recomputed. Previously, when degree[u] < K before merge, the\nstale low degree was kept, which could push a high-degree merged\nnode into simplify_worklist with wrong metadata.\n\nAlso remove redundant if(!remaining.empty()) guard in spill path\nand clean up extra brace from removed GiveUpPhase.
1 week ago
黄熙哲 bef03ec220 chore: update instruction count baseline after Module D rewrite\n\n54/60 performance tests reduced. Key improvements:\n- conv2d: -95 lines (12.6%)\n- huffman: -44 lines (4.9%)\n- fft: -39 lines (5.9%)\n- crc: -38 lines (11.6%)\n- 03_sort: -28 lines (4.2%)\n- 01_mm: -22 lines (6.6%)\n\nAlso fix count_asm.sh sed to match any current value.
1 week ago
黄熙哲 570253f1f2 feat(backend): relax Briggs threshold to 2*K and fix move_adj self-loop\n\nUsing >= 2*K instead of >= K for high-degree neighbor count allows\nmore node pairs to be safely merged. Fixed a bug in MergeInto where\nmove_adj[u] could contain u (self-loop) when v's move set included u,\ncausing iterator invalidation during move_adj cleanup.
1 week ago