deploy-20250820-3 #1

Merged
gh0s7 merged 352 commits from deploy-20250820-3 into master 2025-08-20 21:20:33 +08:00
2 changed files with 9 additions and 9 deletions
Showing only changes of commit 06b4df79ee - Show all commits

View File

@@ -208,12 +208,12 @@ std::string RISCv64CodeGen::function_gen(Function* func) {
std::stringstream ss_after_isel;
RISCv64AsmPrinter printer_isel(mfunc.get());
printer_isel.run(ss_after_isel, true);
DEBUG = 1;
// DEBUG = 1;
if (DEBUG) {
std::cerr << "====== Intermediate Representation after Instruction Selection ======\n"
<< ss_after_isel.str();
}
DEBUG = 0;
// DEBUG = 0;
// 阶段 2: 消除帧索引 (展开伪指令,计算局部变量偏移)
EliminateFrameIndicesPass efi_pass;
efi_pass.runOnMachineFunction(mfunc.get());

View File

@@ -185,19 +185,19 @@ void PassManager::runOptimizationPipeline(Module* moduleIR, IRBuilder* builderIR
printPasses();
}
this->clearPasses();
this->addPass(&LoopStrengthReduction::ID);
this->run();
// this->clearPasses();
// this->addPass(&LoopStrengthReduction::ID);
// this->run();
if(DEBUG) {
std::cout << "=== IR After Loop Normalization, and Strength Reduction Optimizations ===\n";
printPasses();
}
// 全局强度削弱优化,包括代数优化和魔数除法
this->clearPasses();
this->addPass(&GlobalStrengthReduction::ID);
this->run();
// // 全局强度削弱优化,包括代数优化和魔数除法
// this->clearPasses();
// this->addPass(&GlobalStrengthReduction::ID);
// this->run();
if(DEBUG) {
std::cout << "=== IR After Global Strength Reduction Optimizations ===\n";