@@ -202,7 +202,7 @@ namespace {
202202 /// When an instruction is simplified, add all users of the instruction to
203203 /// the work lists because they might get more simplified now.
204204 void AddUsersToWorklist(SDNode *N) {
205- for (SDNode *Node : N->uses ())
205+ for (SDNode *Node : N->users ())
206206 AddToWorklist(Node);
207207 }
208208
@@ -1113,7 +1113,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
11131113 : N1.getConstantOperandVal(1)));
11141114 if (Opc == ISD::SUB)
11151115 ScalableOffset = -ScalableOffset;
1116- if (all_of(N->uses (), [&](SDNode *Node) {
1116+ if (all_of(N->users (), [&](SDNode *Node) {
11171117 if (auto *LoadStore = dyn_cast<MemSDNode>(Node);
11181118 LoadStore && LoadStore->getBasePtr().getNode() == N) {
11191119 TargetLoweringBase::AddrMode AM;
@@ -1151,7 +1151,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
11511151 return false;
11521152 const int64_t CombinedValue = CombinedValueIntVal.getSExtValue();
11531153
1154- for (SDNode *Node : N->uses ()) {
1154+ for (SDNode *Node : N->users ()) {
11551155 if (auto *LoadStore = dyn_cast<MemSDNode>(Node)) {
11561156 // Is x[offset2] already not a legal addressing mode? If so then
11571157 // reassociating the constants breaks nothing (we test offset2 because
@@ -1176,7 +1176,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
11761176 if (GA->getOpcode() == ISD::GlobalAddress && TLI.isOffsetFoldingLegal(GA))
11771177 return false;
11781178
1179- for (SDNode *Node : N->uses ()) {
1179+ for (SDNode *Node : N->users ()) {
11801180 auto *LoadStore = dyn_cast<MemSDNode>(Node);
11811181 if (!LoadStore)
11821182 return false;
@@ -4720,7 +4720,7 @@ SDValue DAGCombiner::useDivRem(SDNode *Node) {
47204720 SDValue Op0 = Node->getOperand(0);
47214721 SDValue Op1 = Node->getOperand(1);
47224722 SDValue combined;
4723- for (SDNode *User : Op0->uses ()) {
4723+ for (SDNode *User : Op0->users ()) {
47244724 if (User == Node || User->getOpcode() == ISD::DELETED_NODE ||
47254725 User->use_empty())
47264726 continue;
@@ -10369,7 +10369,7 @@ static SDValue combineShiftToMULH(SDNode *N, const SDLoc &DL, SelectionDAG &DAG,
1036910369 unsigned MulLoHiOp = IsSignExt ? ISD::SMUL_LOHI : ISD::UMUL_LOHI;
1037010370 if (!ShiftOperand.hasOneUse() &&
1037110371 TLI.isOperationLegalOrCustom(MulLoHiOp, NarrowVT) &&
10372- llvm::any_of(ShiftOperand->uses (), UserOfLowerBits)) {
10372+ llvm::any_of(ShiftOperand->users (), UserOfLowerBits)) {
1037310373 return SDValue();
1037410374 }
1037510375
@@ -13570,7 +13570,7 @@ static SDValue tryToFoldExtOfLoad(SelectionDAG &DAG, DAGCombiner &Combiner,
1357013570 if (NonNegZExt) {
1357113571 assert(ExtLoadType == ISD::ZEXTLOAD && ExtOpc == ISD::ZERO_EXTEND &&
1357213572 "Unexpected load type or opcode");
13573- for (SDNode *User : N0->uses ()) {
13573+ for (SDNode *User : N0->users ()) {
1357413574 if (User->getOpcode() == ISD::SETCC) {
1357513575 ISD::CondCode CC = cast<CondCodeSDNode>(User->getOperand(2))->get();
1357613576 if (ISD::isSignedIntSetCC(CC)) {
@@ -17673,7 +17673,7 @@ SDValue DAGCombiner::combineRepeatedFPDivisors(SDNode *N) {
1767317673 // Find all FDIV users of the same divisor.
1767417674 // Use a set because duplicates may be present in the user list.
1767517675 SetVector<SDNode *> Users;
17676- for (auto *U : N1->uses ()) {
17676+ for (auto *U : N1->users ()) {
1767717677 if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1) {
1767817678 // Skip X/sqrt(X) that has not been simplified to sqrt(X) yet.
1767917679 if (U->getOperand(1).getOpcode() == ISD::FSQRT &&
@@ -18965,15 +18965,15 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
1896518965 // Now check for #3 and #4.
1896618966 bool RealUse = false;
1896718967
18968- for (SDNode *Use : Ptr->uses ()) {
18969- if (Use == N)
18968+ for (SDNode *User : Ptr->users ()) {
18969+ if (User == N)
1897018970 continue;
18971- if (SDNode::hasPredecessorHelper(Use , Visited, Worklist, MaxSteps))
18971+ if (SDNode::hasPredecessorHelper(User , Visited, Worklist, MaxSteps))
1897218972 return false;
1897318973
1897418974 // If Ptr may be folded in addressing mode of other use, then it's
1897518975 // not profitable to do this transformation.
18976- if (!canFoldInAddressingMode(Ptr.getNode(), Use , DAG, TLI))
18976+ if (!canFoldInAddressingMode(Ptr.getNode(), User , DAG, TLI))
1897718977 RealUse = true;
1897818978 }
1897918979
@@ -19089,29 +19089,29 @@ static bool shouldCombineToPostInc(SDNode *N, SDValue Ptr, SDNode *PtrUse,
1908919089
1909019090 SmallPtrSet<const SDNode *, 32> Visited;
1909119091 unsigned MaxSteps = SelectionDAG::getHasPredecessorMaxSteps();
19092- for (SDNode *Use : BasePtr->uses ()) {
19093- if (Use == Ptr.getNode())
19092+ for (SDNode *User : BasePtr->users ()) {
19093+ if (User == Ptr.getNode())
1909419094 continue;
1909519095
1909619096 // No if there's a later user which could perform the index instead.
19097- if (isa<MemSDNode>(Use )) {
19097+ if (isa<MemSDNode>(User )) {
1909819098 bool IsLoad = true;
1909919099 bool IsMasked = false;
1910019100 SDValue OtherPtr;
19101- if (getCombineLoadStoreParts(Use , ISD::POST_INC, ISD::POST_DEC, IsLoad,
19101+ if (getCombineLoadStoreParts(User , ISD::POST_INC, ISD::POST_DEC, IsLoad,
1910219102 IsMasked, OtherPtr, TLI)) {
1910319103 SmallVector<const SDNode *, 2> Worklist;
19104- Worklist.push_back(Use );
19104+ Worklist.push_back(User );
1910519105 if (SDNode::hasPredecessorHelper(N, Visited, Worklist, MaxSteps))
1910619106 return false;
1910719107 }
1910819108 }
1910919109
1911019110 // If all the uses are load / store addresses, then don't do the
1911119111 // transformation.
19112- if (Use ->getOpcode() == ISD::ADD || Use ->getOpcode() == ISD::SUB) {
19113- for (SDNode *UseUse : Use->uses ())
19114- if (canFoldInAddressingMode(Use, UseUse , DAG, TLI))
19112+ if (User ->getOpcode() == ISD::ADD || User ->getOpcode() == ISD::SUB) {
19113+ for (SDNode *UserUser : User->users ())
19114+ if (canFoldInAddressingMode(User, UserUser , DAG, TLI))
1911519115 return false;
1911619116 }
1911719117 }
@@ -19136,7 +19136,7 @@ static SDNode *getPostIndexedLoadStoreOp(SDNode *N, bool &IsLoad,
1913619136 // nor a successor of N. Otherwise, if Op is folded that would
1913719137 // create a cycle.
1913819138 unsigned MaxSteps = SelectionDAG::getHasPredecessorMaxSteps();
19139- for (SDNode *Op : Ptr->uses ()) {
19139+ for (SDNode *Op : Ptr->users ()) {
1914019140 // Check for #1.
1914119141 if (!shouldCombineToPostInc(N, Ptr, Op, BasePtr, Offset, AM, DAG, TLI))
1914219142 continue;
@@ -20515,24 +20515,24 @@ bool DAGCombiner::isMulAddWithConstProfitable(SDNode *MulNode, SDValue AddNode,
2051520515 return true;
2051620516
2051720517 // Walk all the users of the constant with which we're multiplying.
20518- for (SDNode *Use : ConstNode->uses ()) {
20519- if (Use == MulNode) // This use is the one we're on right now. Skip it.
20518+ for (SDNode *User : ConstNode->users ()) {
20519+ if (User == MulNode) // This use is the one we're on right now. Skip it.
2052020520 continue;
2052120521
20522- if (Use ->getOpcode() == ISD::MUL) { // We have another multiply use.
20522+ if (User ->getOpcode() == ISD::MUL) { // We have another multiply use.
2052320523 SDNode *OtherOp;
2052420524 SDNode *MulVar = AddNode.getOperand(0).getNode();
2052520525
2052620526 // OtherOp is what we're multiplying against the constant.
20527- if (Use ->getOperand(0) == ConstNode)
20528- OtherOp = Use ->getOperand(1).getNode();
20527+ if (User ->getOperand(0) == ConstNode)
20528+ OtherOp = User ->getOperand(1).getNode();
2052920529 else
20530- OtherOp = Use ->getOperand(0).getNode();
20530+ OtherOp = User ->getOperand(0).getNode();
2053120531
2053220532 // Check to see if multiply is with the same operand of our "add".
2053320533 //
2053420534 // ConstNode = CONST
20535- // Use = ConstNode * A <-- visiting Use . OtherOp is A.
20535+ // User = ConstNode * A <-- visiting User . OtherOp is A.
2053620536 // ...
2053720537 // AddNode = (A + c1) <-- MulVar is A.
2053820538 // = AddNode * ConstNode <-- current visiting instruction.
@@ -20550,7 +20550,7 @@ bool DAGCombiner::isMulAddWithConstProfitable(SDNode *MulNode, SDValue AddNode,
2055020550 // ... = AddNode * ConstNode <-- current visiting instruction.
2055120551 // ...
2055220552 // OtherOp = (A + c2)
20553- // Use = OtherOp * ConstNode <-- visiting Use .
20553+ // User = OtherOp * ConstNode <-- visiting User .
2055420554 //
2055520555 // If we make this transformation, we will have a common
2055620556 // multiply (CONST * A) after we also do the same transformation
@@ -22902,7 +22902,7 @@ bool DAGCombiner::refineExtractVectorEltIntoMultipleNarrowExtractVectorElts(
2290222902 // Did we fail to model any of the users of the Producer?
2290322903 bool ProducerIsLeaf = false;
2290422904 // Look at each user of this Producer.
22905- for (SDNode *User : E.Producer->uses ()) {
22905+ for (SDNode *User : E.Producer->users ()) {
2290622906 switch (User->getOpcode()) {
2290722907 // TODO: support ISD::BITCAST
2290822908 // TODO: support ISD::ANY_EXTEND
@@ -23176,14 +23176,14 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
2317623176
2317723177 // If only EXTRACT_VECTOR_ELT nodes use the source vector we can
2317823178 // simplify it based on the (valid) extraction indices.
23179- if (llvm::all_of(VecOp->uses (), [&](SDNode *Use) {
23179+ if (llvm::all_of(VecOp->users (), [&](SDNode *Use) {
2318023180 return Use->getOpcode() == ISD::EXTRACT_VECTOR_ELT &&
2318123181 Use->getOperand(0) == VecOp &&
2318223182 isa<ConstantSDNode>(Use->getOperand(1));
2318323183 })) {
2318423184 APInt DemandedElts = APInt::getZero(NumElts);
23185- for (SDNode *Use : VecOp->uses ()) {
23186- auto *CstElt = cast<ConstantSDNode>(Use ->getOperand(1));
23185+ for (SDNode *User : VecOp->users ()) {
23186+ auto *CstElt = cast<ConstantSDNode>(User ->getOperand(1));
2318723187 if (CstElt->getAPIntValue().ult(NumElts))
2318823188 DemandedElts.setBit(CstElt->getZExtValue());
2318923189 }
@@ -27302,7 +27302,7 @@ SDValue DAGCombiner::visitGET_FPENV_MEM(SDNode *N) {
2730227302 // Check if the memory, where FP state is written to, is used only in a single
2730327303 // load operation.
2730427304 LoadSDNode *LdNode = nullptr;
27305- for (auto *U : Ptr->uses ()) {
27305+ for (auto *U : Ptr->users ()) {
2730627306 if (U == N)
2730727307 continue;
2730827308 if (auto *Ld = dyn_cast<LoadSDNode>(U)) {
@@ -27352,7 +27352,7 @@ SDValue DAGCombiner::visitSET_FPENV_MEM(SDNode *N) {
2735227352
2735327353 // Check if the address of FP state is used also in a store operation only.
2735427354 StoreSDNode *StNode = nullptr;
27355- for (auto *U : Ptr->uses ()) {
27355+ for (auto *U : Ptr->users ()) {
2735627356 if (U == N)
2735727357 continue;
2735827358 if (auto *St = dyn_cast<StoreSDNode>(U)) {
0 commit comments