[midend]优化中端框架,移除无用旧代码,ignore格式文件
This commit is contained in:
@@ -13,13 +13,10 @@ using namespace antlr4;
|
||||
|
||||
#include "SysYIRGenerator.h"
|
||||
#include "SysYIRPrinter.h"
|
||||
#include "SysYIRCFGOpt.h"
|
||||
#include "SysYIRCFGOpt.h" // 包含 CFG 优化
|
||||
#include "RISCv64Backend.h"
|
||||
// #include "SysYIRAnalyser.h"
|
||||
// #include "DeadCodeElimination.h"
|
||||
#include "Pass.h" // 包含新的 Pass 框架
|
||||
#include "AddressCalculationExpansion.h"
|
||||
// #include "Mem2Reg.h"
|
||||
// #include "Reg2Mem.h"
|
||||
|
||||
using namespace sysy;
|
||||
|
||||
@@ -131,17 +128,13 @@ int main(int argc, char **argv) {
|
||||
if (argStopAfter == "ird") {
|
||||
DEBUG = 1; // 这里可能需要更精细地控制 DEBUG 的开启时机和范围
|
||||
}
|
||||
// 默认优化 pass (在所有优化级别都会执行)
|
||||
SysYCFGOpt cfgopt(moduleIR, builder);
|
||||
cfgopt.SysYOptimizateAfterIR();
|
||||
|
||||
// ControlFlowAnalysis cfa(moduleIR);
|
||||
// cfa.init();
|
||||
// ActiveVarAnalysis ava;
|
||||
// ava.init(moduleIR);
|
||||
|
||||
// 创建 Pass 管理器并运行优化管道
|
||||
PassManager passManager(moduleIR); // 创建 Pass 管理器
|
||||
passManager.runOptimizationPipeline(moduleIR, optLevel);
|
||||
|
||||
if (DEBUG) {
|
||||
cout << "=== After CFA & AVA (Default) ===\n";
|
||||
cout << "=== Init IR ===\n";
|
||||
SysYPrinter(moduleIR).printIR(); // 临时打印器用于调试
|
||||
}
|
||||
AddressCalculationExpansion ace(moduleIR, builder);
|
||||
|
||||
Reference in New Issue
Block a user