[backend]暂时禁用中端强度削弱
This commit is contained in:
@@ -208,12 +208,12 @@ std::string RISCv64CodeGen::function_gen(Function* func) {
|
|||||||
std::stringstream ss_after_isel;
|
std::stringstream ss_after_isel;
|
||||||
RISCv64AsmPrinter printer_isel(mfunc.get());
|
RISCv64AsmPrinter printer_isel(mfunc.get());
|
||||||
printer_isel.run(ss_after_isel, true);
|
printer_isel.run(ss_after_isel, true);
|
||||||
DEBUG = 1;
|
// DEBUG = 1;
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
std::cerr << "====== Intermediate Representation after Instruction Selection ======\n"
|
std::cerr << "====== Intermediate Representation after Instruction Selection ======\n"
|
||||||
<< ss_after_isel.str();
|
<< ss_after_isel.str();
|
||||||
}
|
}
|
||||||
DEBUG = 0;
|
// DEBUG = 0;
|
||||||
// 阶段 2: 消除帧索引 (展开伪指令,计算局部变量偏移)
|
// 阶段 2: 消除帧索引 (展开伪指令,计算局部变量偏移)
|
||||||
EliminateFrameIndicesPass efi_pass;
|
EliminateFrameIndicesPass efi_pass;
|
||||||
efi_pass.runOnMachineFunction(mfunc.get());
|
efi_pass.runOnMachineFunction(mfunc.get());
|
||||||
|
|||||||
@@ -185,19 +185,19 @@ void PassManager::runOptimizationPipeline(Module* moduleIR, IRBuilder* builderIR
|
|||||||
printPasses();
|
printPasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
this->clearPasses();
|
// this->clearPasses();
|
||||||
this->addPass(&LoopStrengthReduction::ID);
|
// this->addPass(&LoopStrengthReduction::ID);
|
||||||
this->run();
|
// this->run();
|
||||||
|
|
||||||
if(DEBUG) {
|
if(DEBUG) {
|
||||||
std::cout << "=== IR After Loop Normalization, and Strength Reduction Optimizations ===\n";
|
std::cout << "=== IR After Loop Normalization, and Strength Reduction Optimizations ===\n";
|
||||||
printPasses();
|
printPasses();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 全局强度削弱优化,包括代数优化和魔数除法
|
// // 全局强度削弱优化,包括代数优化和魔数除法
|
||||||
this->clearPasses();
|
// this->clearPasses();
|
||||||
this->addPass(&GlobalStrengthReduction::ID);
|
// this->addPass(&GlobalStrengthReduction::ID);
|
||||||
this->run();
|
// this->run();
|
||||||
|
|
||||||
if(DEBUG) {
|
if(DEBUG) {
|
||||||
std::cout << "=== IR After Global Strength Reduction Optimizations ===\n";
|
std::cout << "=== IR After Global Strength Reduction Optimizations ===\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user