docs(doc): 文档添加mem2reg内容

This commit is contained in:
jing
2026-03-09 21:21:55 +08:00
parent 0d3e4795ee
commit a16120dbdf
4 changed files with 95 additions and 22 deletions

View File

@@ -2,6 +2,7 @@ add_library(ir_passes STATIC
PassManager.cpp
Mem2Reg.cpp
ConstFold.cpp
CSE.cpp
DCE.cpp
CFGSimplify.cpp
)

5
src/ir/passes/CSE.cpp Normal file
View File

@@ -0,0 +1,5 @@
// 公共子表达式消除CSE
// - 识别并复用重复计算的等价表达式
// - 典型放置在 ConstFold 之后、DCE 之前
// - 当前为 Lab5 的框架占位,具体算法由实验实现

View File

@@ -1,4 +1,9 @@
// IR Pass 管理:
// - 按优化级别组织优化 pipeline
// - 统一运行 pass、统计与调试输出按需要扩展
//
// Lab5 推荐顺序(可迭代多轮):
// 1. ConstFold
// 2. CSE
// 3. DCE
// 4. CFGSimplify