[SysYIROptUtils]增加通用优化工具类,修改相关代码

This commit is contained in:
rain2133
2025-07-16 14:21:00 +08:00
parent f4d599a567
commit 5a6cfbee1e
9 changed files with 77 additions and 106 deletions

View File

@@ -8,6 +8,7 @@
#include "IR.h"
#include "IRBuilder.h"
#include "SysYIRAnalyser.h"
#include "SysYIROptUtils.h"
namespace sysy {
/**
@@ -51,9 +52,6 @@ private:
auto getPredIndex(BasicBlock *n, BasicBlock *s) -> int; ///< 获取前驱索引
auto cascade(Instruction *instr, bool &changed, Function *func, BasicBlock *block,
std::list<std::unique_ptr<Instruction>> &instrs) -> void; ///< 消除级联关系
auto isGlobal(Value *val) -> bool; ///< 判断是否是全局变量
auto isArr(Value *val) -> bool; ///< 判断是否是数组
auto usedelete(Instruction *instr) -> void; ///< 删除指令相关的value-use-user关系
};
} // namespace sysy