From fbea91986d06d8e22a78d4072bf48bd5e1c0fe76 Mon Sep 17 00:00:00 2001 From: lzkk <956449176@qq.com> Date: Tue, 26 May 2026 19:59:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(mir):=20=E6=8C=87=E4=BB=A4=E7=BA=A7?= =?UTF-8?q?=E6=B4=BB=E5=8F=98=E9=87=8F=E5=88=86=E6=9E=90=20+=20CLI/?= =?UTF-8?q?=E6=9E=84=E5=BB=BA=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InstLiveness: 三阶段算法(块级 fixpoint + 指令反向扫描 + 区间构建) - 支持 phi-copy 插入环境(非严格 SSA):union 区间 - CLI.h 添加 regalloc 字段,支持 --regalloc=linear/graphcoloring --- src/utils/CLI.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/utils/CLI.cpp b/src/utils/CLI.cpp index 16245faa..1f37c290 100644 --- a/src/utils/CLI.cpp +++ b/src/utils/CLI.cpp @@ -87,6 +87,17 @@ CLIOptions ParseCLI(int argc, char** argv) { continue; } + // 寄存器分配器选择 + if (std::strncmp(arg, "--regalloc=", 12) == 0) { + opt.regalloc = arg + 12; + if (opt.regalloc != "linear" && opt.regalloc != "graphcoloring") { + throw std::runtime_error( + FormatError("cli", std::string("未知寄存器分配器: ") + opt.regalloc + + "(可选: graphcoloring, linear)")); + } + continue; + } + // 兼容旧格式 if (std::strcmp(arg, "--emit-parse-tree") == 0) { if (!explicit_emit) {