an index. This code is on the hot-path because the current
way SDep edges are uniqued has quadratic complexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64262
91177308-0d34-0410-b5e6-
96231b3b80d8
/// specified node.
void SUnit::addPred(const SDep &D) {
// If this node already has this depenence, don't add a redundant one.
/// specified node.
void SUnit::addPred(const SDep &D) {
// If this node already has this depenence, don't add a redundant one.
- for (unsigned i = 0, e = (unsigned)Preds.size(); i != e; ++i)
- if (Preds[i] == D)
+ for (SmallVector<SDep, 4>::const_iterator I = Preds.begin(), E = Preds.end();
+ I != E; ++I)
+ if (*I == D)
return;
// Now add a corresponding succ to N.
SDep P = D;
return;
// Now add a corresponding succ to N.
SDep P = D;