[midend-phielimination]消除只有一个incomingvalue的phi指令
This commit is contained in:
@@ -74,6 +74,7 @@ void DCEContext::run(Function *func, AnalysisManager *AM, bool &changed) {
|
||||
}
|
||||
}
|
||||
}
|
||||
changed |= SysYIROptUtils::eliminateRedundantPhisInFunction(func); // 如果有活跃指令,则标记为已更改
|
||||
}
|
||||
|
||||
// 判断指令是否是"天然活跃"的实现
|
||||
|
||||
@@ -39,7 +39,7 @@ bool GVN::runOnFunction(Function *func, AnalysisManager &AM) {
|
||||
}
|
||||
std::cout << "=== GVN completed for function: " << func->getName() << " ===" << std::endl;
|
||||
}
|
||||
|
||||
changed |= SysYIROptUtils::eliminateRedundantPhisInFunction(func);
|
||||
return changed;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,7 @@ bool InductionVariableEliminationContext::run(Function* F, AnalysisManager& AM)
|
||||
printDebugInfo();
|
||||
}
|
||||
|
||||
modified |= SysYIROptUtils::eliminateRedundantPhisInFunction(F);
|
||||
return modified;
|
||||
}
|
||||
|
||||
|
||||
@@ -1357,9 +1357,8 @@ void SCCPContext::run(Function *func, AnalysisManager &AM) {
|
||||
bool changed_control_flow = SimplifyControlFlow(func);
|
||||
|
||||
// 如果任何一个阶段修改了 IR,标记分析结果为失效
|
||||
if (changed_constant_propagation || changed_control_flow) {
|
||||
// AM.invalidate(); // 假设有这样的方法来使所有分析结果失效
|
||||
}
|
||||
bool changed = changed_constant_propagation || changed_control_flow;
|
||||
changed |= SysYIROptUtils::eliminateRedundantPhisInFunction(func);
|
||||
}
|
||||
|
||||
// SCCP Pass methods
|
||||
|
||||
Reference in New Issue
Block a user