From 21a6283ee29cc74b0fc0c0ababbee29b95d3a8aa Mon Sep 17 00:00:00 2001 From: lixuanwang Date: Wed, 20 Aug 2025 13:29:40 +0800 Subject: [PATCH] =?UTF-8?q?[deploy]=E5=8F=96=E6=B6=88m2r=E5=88=B0r2m?= =?UTF-8?q?=E7=9A=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/midend/Pass/Pass.cpp | 112 +++++++++++++++++++-------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/src/midend/Pass/Pass.cpp b/src/midend/Pass/Pass.cpp index ba258d1..c7c3626 100644 --- a/src/midend/Pass/Pass.cpp +++ b/src/midend/Pass/Pass.cpp @@ -128,77 +128,77 @@ void PassManager::runOptimizationPipeline(Module* moduleIR, IRBuilder* builderIR this->addPass(&Mem2Reg::ID); this->run(); - if(DEBUG) { - std::cout << "=== IR After Mem2Reg Optimizations ===\n"; - printPasses(); - } + // if(DEBUG) { + // std::cout << "=== IR After Mem2Reg Optimizations ===\n"; + // printPasses(); + // } + + // // this->clearPasses(); + // // this->addPass(&GVN::ID); + // // this->run(); // this->clearPasses(); - // this->addPass(&GVN::ID); + // this->addPass(&TailCallOpt::ID); // this->run(); - this->clearPasses(); - this->addPass(&TailCallOpt::ID); - this->run(); + // if(DEBUG) { + // std::cout << "=== IR After TailCallOpt ===\n"; + // SysYPrinter printer(moduleIR); + // printer.printIR(); + // } - if(DEBUG) { - std::cout << "=== IR After TailCallOpt ===\n"; - SysYPrinter printer(moduleIR); - printer.printIR(); - } + // if(DEBUG) { + // std::cout << "=== IR After GVN Optimizations ===\n"; + // printPasses(); + // } - if(DEBUG) { - std::cout << "=== IR After GVN Optimizations ===\n"; - printPasses(); - } + // // this->clearPasses(); + // // this->addPass(&SCCP::ID); + // // this->run(); + + // if(DEBUG) { + // std::cout << "=== IR After SCCP Optimizations ===\n"; + // printPasses(); + // } // this->clearPasses(); - // this->addPass(&SCCP::ID); + // this->addPass(&LoopNormalizationPass::ID); + // this->addPass(&InductionVariableElimination::ID); // this->run(); - if(DEBUG) { - std::cout << "=== IR After SCCP Optimizations ===\n"; - printPasses(); - } - - this->clearPasses(); - this->addPass(&LoopNormalizationPass::ID); - this->addPass(&InductionVariableElimination::ID); - this->run(); - - if(DEBUG) { - std::cout << "=== IR After Loop Normalization, Induction Variable Elimination ===\n"; - printPasses(); - } + // if(DEBUG) { + // std::cout << "=== IR After Loop Normalization, Induction Variable Elimination ===\n"; + // printPasses(); + // } - this->clearPasses(); - this->addPass(&LICM::ID); - this->run(); - - if(DEBUG) { - std::cout << "=== IR After LICM ===\n"; - printPasses(); - } - - 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->addPass(&LICM::ID); // this->run(); - if(DEBUG) { - std::cout << "=== IR After Global Strength Reduction Optimizations ===\n"; - printPasses(); - } + // if(DEBUG) { + // std::cout << "=== IR After LICM ===\n"; + // printPasses(); + // } + + // 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(); + + // if(DEBUG) { + // std::cout << "=== IR After Global Strength Reduction Optimizations ===\n"; + // printPasses(); + // } this->clearPasses(); this->addPass(&Reg2Mem::ID);