@@ -15879,8 +15879,9 @@ static bool isValidBaseUpdate(SDNode *N, SDNode *User) {
15879
15879
SmallVector<const SDNode *, 16> Worklist;
15880
15880
Worklist.push_back(N);
15881
15881
Worklist.push_back(User);
15882
- if (SDNode::hasPredecessorHelper(N, Visited, Worklist, 1024) ||
15883
- SDNode::hasPredecessorHelper(User, Visited, Worklist, 1024))
15882
+ const unsigned MaxSteps = 1024;
15883
+ if (SDNode::hasPredecessorHelper(N, Visited, Worklist, MaxSteps) ||
15884
+ SDNode::hasPredecessorHelper(User, Visited, Worklist, MaxSteps))
15884
15885
return false;
15885
15886
return true;
15886
15887
}
@@ -16270,7 +16271,7 @@ static SDValue CombineBaseUpdate(SDNode *N,
16270
16271
16271
16272
if (ConstInc || User->getOpcode() == ISD::ADD) {
16272
16273
BaseUpdates.push_back({User, Inc, ConstInc});
16273
- if (BaseUpdates.size() > MaxBaseUpdates)
16274
+ if (BaseUpdates.size() >= MaxBaseUpdates)
16274
16275
break;
16275
16276
}
16276
16277
}
@@ -16299,7 +16300,7 @@ static SDValue CombineBaseUpdate(SDNode *N,
16299
16300
unsigned NewConstInc = UserOffset - Offset;
16300
16301
SDValue NewInc = DCI.DAG.getConstant(NewConstInc, SDLoc(N), MVT::i32);
16301
16302
BaseUpdates.push_back({User, NewInc, NewConstInc});
16302
- if (BaseUpdates.size() > MaxBaseUpdates)
16303
+ if (BaseUpdates.size() >= MaxBaseUpdates)
16303
16304
break;
16304
16305
}
16305
16306
}
@@ -16367,8 +16368,9 @@ static SDValue PerformMVEVLDCombine(SDNode *N,
16367
16368
Visited.insert(Addr.getNode());
16368
16369
Worklist.push_back(N);
16369
16370
Worklist.push_back(User);
16370
- if (SDNode::hasPredecessorHelper(N, Visited, Worklist, 1024) ||
16371
- SDNode::hasPredecessorHelper(User, Visited, Worklist, 1024))
16371
+ const unsigned MaxSteps = 1024;
16372
+ if (SDNode::hasPredecessorHelper(N, Visited, Worklist, MaxSteps) ||
16373
+ SDNode::hasPredecessorHelper(User, Visited, Worklist, MaxSteps))
16372
16374
continue;
16373
16375
16374
16376
// Find the new opcode for the updating load/store.
0 commit comments