[midend-LICM][fix]修复循环不变量的识别逻辑
This commit is contained in:
@@ -55,10 +55,11 @@ bool LICMContext::hoistInstructions() {
|
||||
}
|
||||
}
|
||||
|
||||
// 检查是否全部排序,若未全部排序,说明有环(理论上不会)
|
||||
// 检查是否全部排序,若未全部排序,打印错误信息
|
||||
// 这可能是因为存在循环依赖或其他问题导致无法完成拓扑排序
|
||||
if (sorted.size() != workSet.size()) {
|
||||
if (DEBUG)
|
||||
std::cerr << "LICM: Topological sort failed, possible dependency cycle." << std::endl;
|
||||
std::cout << "LICM: Topological sort failed, possible dependency cycle." << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user