You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhm
31b06afd35
feat: 实现基本标量优化 (Lab4)
主要功能:
- 实现 Dead Store Elimination (DSE) 优化
- 检测并删除无用的 store 指令
- 删除未被使用的 alloca 指令
- 对 dead-code-elimination 测试效果显著 (99%+ 指令减少)
- 实现 LICM (Loop Invariant Code Motion) 优化
- 循环不变量检测和外提
- 目前暂时禁用 (PHI 节点在 llc -O0 下性能问题)
优化改进:
- Mem2Reg: 添加启发式跳过复杂函数,避免性能问题
- CFGSimplify: 改进基本块删除逻辑
- ConstProp: 改进常量传播
- DCE: 重构为包含 DSE 的完整实现
测试脚本改进:
- test4.sh: 支持 IR/ASM 模式,与 baseline 对比
- test4_instcount.sh: 新增指令数量对比测试
- verify_ir.sh: 时间测量改为只测量执行时间 (不含编译链接)
- verify_asm.sh: 同步更新
其他:
- BasicBlock: 新增 TakeInstruction, InsertInstructionBeforeTerminator 方法
- PassManager: 调整优化顺序,禁用 Mem2Reg 和 LICM
- .gitignore: 添加 lab4_instcount_results/
|
1 week ago |
| .. |
|
frontend
|
refactor(dev): 移动头文件位置
|
2 months ago |
|
ir
|
feat: 实现基本标量优化 (Lab4)
|
1 week ago |
|
irgen
|
lab2
|
1 month ago |
|
mir
|
lab3
|
2 weeks ago |
|
sem
|
lab2
|
1 month ago |
|
utils
|
lab3
|
2 weeks ago |