70 Commits (2a67ef0f06fd43ffa7a18e92e26056d93af8515a)

Author SHA1 Message Date
lzkk 2a67ef0f06 perf(mir): FixFallThrough——CondBr 条件反转消除冗余 Br
6 days ago
lzkk 667c342c51 perf(mir): Lowering 立即数折叠——AddRR/SubRR/CmpRR 常量 rhs 直接用 Imm
6 days ago
lzkk d51cbc49f1 perf(mir): RegAlloc 偏置着色调和(copy_edges coalescing)
6 days ago
lzkk 1993380d4a chore: 移除 git 冲突残留文件
6 days ago
lzkk ee3b42ac40 feat(opt): 切换至队友代码基线——100%功能正确
6 days ago
lzkk bfe105c2cd fix(mir): 别名无条件冲突 + per-round reserve防指针失效
6 days ago
lzkk d6f42a2a2e fix(mir): 回退到稳定版本——PhysReg映射+spill reload+别名无条件冲突
6 days ago
lzkk 0f1b545568 fix(mir): 分配顺序改为FirstUsePos + 别名无条件冲突 + per-round reserve
6 days ago
lzkk 83228a8123 fix(mir): GPR32/GPR64别名检查移除segments.empty()条件
6 days ago
lzkk 5fb106bde8 fix(mir): LLVM两遍分配 + 间隙分裂 + Assign安全网
6 days ago
lzkk 508f9d8ddc fix(mir): TrySplit引用失效修复 + LLVM Defer机制
6 days ago
lzkk 80dc583143 fix(mir): PhysReg映射修正 + spill reload分配独立vreg——避免寄存器冲突
6 days ago
lzkk ddaf8831a2 fix(mir): CMakeLists.txt 改用 GreedyAlloc.cpp 替代 LinearScanAlloc.cpp
7 days ago
lzkk da1e456133 feat(mir): 实现 LLVM-style 贪婪寄存器分配器 —— 统一架构
7 days ago
lzkk 0a29e6ac42 fix(mir): AsmPrinter 函数调用后失效帧基址缓存——修复 92_register_alloc
1 week ago
lzkk 363b809736 fix(mir): 大栈帧 asm 输出 x13 缓存失效 + 叶函数栈参数偏移修复 + IR 数组初始化阈值降低
1 week ago
lzkk 120d7197d8 fix(mir): 线性扫描活变量分析 def 位置记录 + callee-saved 寄存器限定 + CLI 标志修复
1 week ago
lzkk 28c336728d fix(mir): 线性扫描区间分裂修复 + 多定义点 vreg 跳过逻辑修复
1 week ago
lzkk 28ad162de4 feat(mir): 线性扫描寄存器分配初始实现(WIP,--regalloc=linear 可用)
1 week ago
lzkk a9ebfdc0e0 feat(mir): 添加指令级活变量分析——精确 [start,end] 区间
1 week ago
lzkk 6c5441ff43 feat(mir): 添加 MIR 验证器和寄存器分配验证器
1 week ago
lzkk c12b6830b8 fix(regalloc): MAX_SPILL_ROUNDS=1 + 保守修复阈值 20→200,修复 spill 错误代码
1 week ago
lzkk d238777f17 fix(regalloc): 根除 spill 代码指数级膨胀——MAX_SPILL_ROUNDS 统一为 3
1 week ago
lzkk 535ab08d32 feat(backend): AsmPrinter 帧基址缓存,避免连续栈访问重复计算地址
1 week ago
lzkk 5300e2c1ec fix(hooks): 修复会话崩溃 + 优化开发规范配置
1 week ago
lzkk 2d3a5ff998 perf(backend): Peephole 新增全局变量 store-load 转发和 load CSE
1 week ago
lzkk b2b7210f11 perf(backend): 除法/取模统一使用 sdiv,删除2的幂次移位序列
1 week ago
lzkk befdca6451 perf(backend): 叶函数跳过帧设置,节省 x29/x30 保存/恢复
1 week ago
lzkk 854168fb4e perf(backend): 消除连续全局变量访问的冗余 ADRP
1 week ago
lzkk acdac5391d fix(backend): EmitLargeImmediate 跳过前导零,避免冗余 movz #0
1 week ago
lzkk fccd935a24 feat(backend): 新增 AddImm/SubImm 操作码,消除冗余 MovImm
1 week ago
lzkk bd7dcedb2a feat(backend): ICmp 降级常量折叠到 CmpImm,消除冗余 MovImm
1 week ago
黄熙哲 6b9cf3a448 fix(backend): add x16/x17 to GP allocatable set to fix segfaults
1 week ago
黄熙哲 5902060dae fix(backend): lower coalesce skip threshold to fix segfaults
1 week 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.
1 week 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.
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.
2 weeks 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.
2 weeks 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.
2 weeks ago
黄熙哲 3691da34ee feat(backend): rewrite main loop with held_nodes release and ReactivatePairs
2 weeks ago
黄熙哲 0881889ec1 feat(backend): add ReactivatePairs and stale_pairs for coalescing
2 weeks ago
黄熙哲 07048a123b feat(backend): separate move-related low-degree nodes into held_nodes
2 weeks ago
黄熙哲 99fe17fc3f feat(backend): propagate coalesced node colors in AssignColors\n\nAfter active coalescing, merged_set nodes inherit their representative's\ncolor, ensuring move-related vregs share the same physical register.
2 weeks ago
黄熙哲 081580ac0a feat(backend): integrate active coalescing into ColorGraph main loop\n\nReplaces inner simplify while-loop with if-else chain:\nSimplify -> MergePhase -> GiveUpPhase -> Spill.\nLambdas moved outside while loop for clarity.
2 weeks ago
黄熙哲 0e4f9f1910 feat(backend): add MergePhase and GiveUpPhase for active coalescing\n\nMergePhase uses the Briggs conservative test to safely merge move-related\nnode pairs before coloring. GiveUpPhase abandons moves for low-degree\nnodes when merging is no longer beneficial.
2 weeks ago
黄熙哲 ca6c2a18c9 feat(backend): add coalesce data structures and helpers to ColorGraph\n\nIntroduces MovePair, move_adj, FindRep, GetRep, HasMovePair as\ninfrastructure for the upcoming Coalesce and Freeze phases.\nModifies simplify loop to skip already-merged nodes via GetRep.
2 weeks ago
黄熙哲 af71513361 feat(backend): use stp/ldp for callee-saved registers in prologue/epilogue\n\nGroups callee-saved X and S registers and emits paired stp/ldp\ninstructions, reducing save/restore overhead by ~50%. Odd remainders\nstill use str/ldr. Adds fallback else branch for future register types.
2 weeks ago
黄熙哲 e26fd3f520 fix(peephole): remove dead conditional branch inversion code\n\nThe CondBr+Branch inversion pattern was unreachable because the\nsimple Br fallthrough check runs first and removes the Br. Removed\nthe dead code and the unused NegateCondCode helper.
2 weeks ago
黄熙哲 7490fd3a49 feat(peephole): add branch fallthrough and conditional branch inversion\n\nEliminates unconditional Br when target is the next block in layout.\nInverts CondBr condition when the following Br targets the fallthrough\nblock, eliminating the extra jump.
2 weeks ago
黄熙哲 1701b2cf51 feat(peephole): merge adjacent zero-value stack stores\n\nWhen str WZR, fi#N and str WZR, fi#N+1 appear consecutively,\nreplaces them with a single str XZR, fi#N (64-bit zero store).
2 weeks ago