[midend]重构中端,建立遍管理器,注册器等,初步构建支配树分析遍,增加基本块方法

This commit is contained in:
rain2133
2025-07-21 15:19:38 +08:00
parent 88604c1f94
commit 550f4017be
5 changed files with 538 additions and 1 deletions

View File

@@ -11,11 +11,14 @@ class SysYIROptUtils{
public:
// 删除use关系
// 根据指令的使用情况删除其所有的use关系
// 找到指令的所有使用者,并从它们的使用列表中删除该指令
static void usedelete(Instruction *instr) {
for (auto &use : instr->getOperands()) {
Value* val = use->getValue();
val->removeUse(use);
}
instr->getParent()->removeInst(instr); // 从基本块中删除指令
}
// 判断是否是全局变量