Skip to content

Commit 02e4ab6

Browse files
committed
移除 ModMulIdiom pass
该惯用法识别优化(递归倍加模乘 → 单宽乘取模)缺乏可描述的合理优化 动机,删除其源文件并取消在 PassManager 中的注册。
1 parent 2a1ec3d commit 02e4ab6

4 files changed

Lines changed: 0 additions & 334 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,6 @@ set(IR_SRCS
301301
ir/passes/modulePass/SmallFunctionInline.cpp
302302
ir/passes/functionPass/TailRecursionElim.h
303303
ir/passes/functionPass/TailRecursionElim.cpp
304-
ir/passes/functionPass/ModMulIdiom.h
305-
ir/passes/functionPass/ModMulIdiom.cpp
306304
ir/passes/functionPass/LateLoopCFGCleanup.h
307305
ir/passes/functionPass/LateLoopCFGCleanup.cpp
308306
ir/passes/functionPass/PhiLowering.h

ir/passes/PassManager.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#include "functionPass/LateLoopCFGCleanup.h"
3737
#include "functionPass/LoopRotate.h"
3838
#include "functionPass/Mem2Reg.h"
39-
#include "functionPass/ModMulIdiom.h"
4039
#include "functionPass/PhiToSelect.h"
4140
#include "functionPass/PhiLowering.h"
4241
#include "functionPass/PureCallCSE.h"
@@ -114,13 +113,6 @@ void PassManager::registerDefaultOptimizationPipeline(int32_t optLevel, bool ena
114113
return false;
115114
});
116115

117-
// 递归倍加模乘惯用法识别:须在 Mem2Reg 后(依赖 SSA 分支形态)、
118-
// GVN/InstCombine 前(避免 srem/sdiv 被变形破坏匹配)
119-
registerFunctionPass("ModMulIdiom", [this](Function * func) {
120-
ModMulIdiom pass(func, module);
121-
return pass.run();
122-
});
123-
124116
registerFunctionPass("GVN", [this](Function * func) {
125117
GVN pass(func, module);
126118
return pass.run();

ir/passes/functionPass/ModMulIdiom.cpp

Lines changed: 0 additions & 284 deletions
This file was deleted.

ir/passes/functionPass/ModMulIdiom.h

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)