[optimze]添加基础的除法指令优化,目前只对除以2的幂数生效

This commit is contained in:
2025-08-03 13:46:42 +08:00
parent e8699d6d25
commit f312792fe9
10 changed files with 419 additions and 6 deletions

View File

@@ -119,7 +119,11 @@ std::string RISCv64CodeGen::function_gen(Function* func) {
RISCv64AsmPrinter printer1(mfunc.get());
printer1.run(ss1, true);
// 阶段 2: 指令调度 (Instruction Scheduling)
// 阶段 2: 除法强度削弱优化 (Division Strength Reduction)
DivStrengthReduction div_strength_reduction;
div_strength_reduction.runOnMachineFunction(mfunc.get());
// 阶段 2.1: 指令调度 (Instruction Scheduling)
PreRA_Scheduler scheduler;
scheduler.runOnMachineFunction(mfunc.get());