feat(mir): 指令级活变量分析 + CLI/构建集成

- InstLiveness: 三阶段算法(块级 fixpoint + 指令反向扫描 + 区间构建)
- 支持 phi-copy 插入环境(非严格 SSA):union 区间
- CLI.h 添加 regalloc 字段,支持 --regalloc=linear/graphcoloring
lzk
lzkk 4 days ago
parent 8f3012cd9f
commit fbea91986d

@ -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) {

Loading…
Cancel
Save