All uses conservatively assume in early exit case that it will be a
predecessor. Changing default removes checking code in all uses.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327169
91177308-0d34-0410-b5e6-
96231b3b80d8
if (Found)
return true;
if (MaxSteps != 0 && Visited.size() >= MaxSteps)
- return false;
+ return true;
}
return false;
}
Worklist.push_back(n->getOperand(j).getNode());
}
// Search through DAG. We can stop early if we find a store node.
- for (unsigned i = 0; i < NumStores; ++i) {
+ for (unsigned i = 0; i < NumStores; ++i)
if (SDNode::hasPredecessorHelper(StoreNodes[i].MemNode, Visited, Worklist,
Max))
return false;
- // Check if we ended early, failing conservatively if so.
- if (Visited.size() >= Max)
- return false;
- }
return true;
}