38 Commits (be3a5640eec3f09e84c30ef90062b701bfcf024b)

Author SHA1 Message Date
lzkk be3a5640ee perf(mir): AArch64 缩放寻址——GEP+Load/Store 直接生成 ldr/str [base, idx, uxtw #2]
4 days ago
lzkk d51cbc49f1 perf(mir): RegAlloc 偏置着色调和(copy_edges coalescing)
4 days ago
lzkk ee3b42ac40 feat(opt): 切换至队友代码基线——100%功能正确
4 days ago
lzkk da1e456133 feat(mir): 实现 LLVM-style 贪婪寄存器分配器 —— 统一架构
5 days ago
lzkk c12b6830b8 fix(regalloc): MAX_SPILL_ROUNDS=1 + 保守修复阈值 20→200,修复 spill 错误代码
6 days ago
lzkk d238777f17 fix(regalloc): 根除 spill 代码指数级膨胀——MAX_SPILL_ROUNDS 统一为 3
6 days ago
lzkk 5300e2c1ec fix(hooks): 修复会话崩溃 + 优化开发规范配置
6 days ago
lzkk fccd935a24 feat(backend): 新增 AddImm/SubImm 操作码,消除冗余 MovImm
7 days 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
黄熙哲 083616e50d fix(backend): add redundant MovReg elimination on no-spill early-return path\n\nThe MovReg cleanup was only running after the final RewriteWithAllocation\nat the end of the spill loop, missing the early-return path when\nallocation succeeded without spilling. This left behind no-op moves\nlike 'mov x0, x0' that coalescing created.
2 weeks ago
黄熙哲 6f829c30f9 feat(backend): eliminate redundant MovReg after register allocation\n\nScans all blocks after RewriteWithAllocation and removes MovReg\ninstructions where source and destination are the same physical\nregister. This cleans up cases where move coalescing successfully\nassigned the same register to both sides.
2 weeks ago
黄熙哲 4bdca3f722 feat(backend): move coalescing via color preference and phi cycle breaking\n\nCollects move_preferences from MovReg instructions and uses them\nduring color selection to prefer the same physical register for\nmove-related virtual registers. Detects and breaks cycles in move\npreference chains to ensure correctness.
2 weeks ago
黄熙哲 535a3c0122 feat(backend): exclude MovReg use from interference during graph build\n\nWhen building the interference graph, temporarily remove the use\noperand of MovReg instructions from the live set before processing\ndefs. This prevents the source and destination of a move from\ninterfering, enabling them to be assigned the same physical register.
2 weeks ago
黄熙哲 4fad027da8 feat(backend): interval-length weighted spill cost model for graph coloring\n\nReplace degree-only spill selection with weighted cost model:\ncost = interval_length * 5 + ref_count * 15 - degree * 25\nLower cost spills first. Rematerializable constants get -100000 bonus.
2 weeks ago
黄熙哲 c84458daed feat(backend): compute interval length and ref count during liveness analysis
2 weeks ago
黄熙哲 4812329aa4 refactor(backend): remove redundant live-out pairwise interference edges
2 weeks ago
黄熙哲 6b39d2d397 fix: add missing FP threshold in second ColorGraph call site
2 weeks ago
黄熙哲 26d89b2fbd fix: parameterize caller-saved threshold for GP/FP in ColorGraph
2 weeks ago
黄熙哲 4d95f33dc2 refactor: make caller-saved color preference explicit in ColorGraph Select phase
2 weeks ago
zhm e9adbe38c7 Fix undefined behavior: signed overflow, negative left shift, float-to-int overflow
3 weeks ago
安峻邑 55d92cda42 fix: 补全缺失的头文件目录
3 weeks ago
安峻邑 dba0d6adc0 fix: 修正头文件包含路径为 include/ 前缀以适配评测系统
3 weeks ago
安峻邑 293c28fed4 fix: 修正头文件包含路径以适配评测系统
3 weeks ago
安峻邑 ac4be4ec7a fix: 修复编译问题以支持测评程序直接编译
3 weeks ago
安峻邑 624f9e307f 已实现基本标量优化,实现部分寄存器优化
3 weeks ago