@@ -18921,10 +18921,7 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
1892118921 SmallVector<SDNode *, 16> OtherUses;
1892218922 unsigned MaxSteps = SelectionDAG::getHasPredecessorMaxSteps();
1892318923 if (isa<ConstantSDNode>(Offset))
18924- for (SDNode::use_iterator UI = BasePtr->use_begin(),
18925- UE = BasePtr->use_end();
18926- UI != UE; ++UI) {
18927- SDUse &Use = *UI;
18924+ for (SDUse &Use : BasePtr->uses()) {
1892818925 // Skip the use that is Ptr and uses of other results from BasePtr's
1892918926 // node (important for nodes that return multiple results).
1893018927 if (Use.getUser() == Ptr.getNode() || Use != BasePtr)
@@ -18940,7 +18937,7 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
1894018937 break;
1894118938 }
1894218939
18943- SDValue Op1 = Use.getUser()->getOperand((UI .getOperandNo() + 1) & 1);
18940+ SDValue Op1 = Use.getUser()->getOperand((Use .getOperandNo() + 1) & 1);
1894418941 if (!isa<ConstantSDNode>(Op1)) {
1894518942 OtherUses.clear();
1894618943 break;
@@ -20931,11 +20928,11 @@ DAGCombiner::getStoreMergeCandidates(StoreSDNode *St,
2093120928 RootCount->second.second > StoreMergeDependenceLimit;
2093220929 };
2093320930
20934- auto TryToAddCandidate = [&](SDNode::use_iterator UseIter ) {
20931+ auto TryToAddCandidate = [&](SDUse &Use ) {
2093520932 // This must be a chain use.
20936- if (UseIter .getOperandNo() != 0)
20933+ if (Use .getOperandNo() != 0)
2093720934 return;
20938- if (auto *OtherStore = dyn_cast<StoreSDNode>(UseIter-> getUser())) {
20935+ if (auto *OtherStore = dyn_cast<StoreSDNode>(Use. getUser())) {
2093920936 BaseIndexOffset Ptr;
2094020937 int64_t PtrDiff;
2094120938 if (CandidateMatch(OtherStore, Ptr, PtrDiff) &&
@@ -20954,19 +20951,19 @@ DAGCombiner::getStoreMergeCandidates(StoreSDNode *St,
2095420951 for (auto I = RootNode->use_begin(), E = RootNode->use_end();
2095520952 I != E && NumNodesExplored < MaxSearchNodes; ++I, ++NumNodesExplored) {
2095620953 SDNode *User = I->getUser();
20957- if (I. getOperandNo() == 0 && isa<LoadSDNode>(User)) { // walk down chain
20958- for (auto I2 = User->use_begin(), E2 = User->use_end(); I2 != E2; ++I2 )
20959- TryToAddCandidate(I2 );
20954+ if (I-> getOperandNo() == 0 && isa<LoadSDNode>(User)) { // walk down chain
20955+ for (SDUse &U2 : User->uses() )
20956+ TryToAddCandidate(U2 );
2096020957 }
2096120958 // Check stores that depend on the root (e.g. Store 3 in the chart above).
20962- if (I. getOperandNo() == 0 && isa<StoreSDNode>(User)) {
20963- TryToAddCandidate(I);
20959+ if (I-> getOperandNo() == 0 && isa<StoreSDNode>(User)) {
20960+ TryToAddCandidate(* I);
2096420961 }
2096520962 }
2096620963 } else {
2096720964 for (auto I = RootNode->use_begin(), E = RootNode->use_end();
2096820965 I != E && NumNodesExplored < MaxSearchNodes; ++I, ++NumNodesExplored)
20969- TryToAddCandidate(I);
20966+ TryToAddCandidate(* I);
2097020967 }
2097120968
2097220969 return RootNode;
0 commit comments