Commit 679d36a7 authored by noveky's avatar noveky
Browse files
No related merge requests found
Showing with 1 addition and 1 deletion
+1 -1
......@@ -120,7 +120,7 @@ void LoopInductionVariableAnalysis::findIndVar(Ptr<Loop> loop) {
if (auto operInst = castPtr<OperInst>(inst)) {
if (operInst->isBinary() && (operInst->op() == OperInst::Operator::Add || operInst->op() == OperInst::Operator::Sub || operInst->op() == OperInst::Operator::Mul || operInst->op() == OperInst::Operator::Div)) {
// 检查操作数是否为归纳变量和循环不变量的组合
if (this->invariantCtx->isInvariant(operInst->lhs())) {
if (this->invariantCtx->isInvariant(operInst->lhs()) && operInst->rhs().isRegister()) {
auto rhsReg = operInst->rhs().getRegister();
if (indVars.find(rhsReg) != indVars.end()) {
// 将新发现的归纳变量加入集合
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment