@@ -202,7 +202,7 @@ namespace {
202
202
/// When an instruction is simplified, add all users of the instruction to
203
203
/// the work lists because they might get more simplified now.
204
204
void AddUsersToWorklist(SDNode *N) {
205
- for (SDNode *Node : N->uses ())
205
+ for (SDNode *Node : N->users ())
206
206
AddToWorklist(Node);
207
207
}
208
208
@@ -1113,7 +1113,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
1113
1113
: N1.getConstantOperandVal(1)));
1114
1114
if (Opc == ISD::SUB)
1115
1115
ScalableOffset = -ScalableOffset;
1116
- if (all_of(N->uses (), [&](SDNode *Node) {
1116
+ if (all_of(N->users (), [&](SDNode *Node) {
1117
1117
if (auto *LoadStore = dyn_cast<MemSDNode>(Node);
1118
1118
LoadStore && LoadStore->getBasePtr().getNode() == N) {
1119
1119
TargetLoweringBase::AddrMode AM;
@@ -1151,7 +1151,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
1151
1151
return false;
1152
1152
const int64_t CombinedValue = CombinedValueIntVal.getSExtValue();
1153
1153
1154
- for (SDNode *Node : N->uses ()) {
1154
+ for (SDNode *Node : N->users ()) {
1155
1155
if (auto *LoadStore = dyn_cast<MemSDNode>(Node)) {
1156
1156
// Is x[offset2] already not a legal addressing mode? If so then
1157
1157
// reassociating the constants breaks nothing (we test offset2 because
@@ -1176,7 +1176,7 @@ bool DAGCombiner::reassociationCanBreakAddressingModePattern(unsigned Opc,
1176
1176
if (GA->getOpcode() == ISD::GlobalAddress && TLI.isOffsetFoldingLegal(GA))
1177
1177
return false;
1178
1178
1179
- for (SDNode *Node : N->uses ()) {
1179
+ for (SDNode *Node : N->users ()) {
1180
1180
auto *LoadStore = dyn_cast<MemSDNode>(Node);
1181
1181
if (!LoadStore)
1182
1182
return false;
@@ -4720,7 +4720,7 @@ SDValue DAGCombiner::useDivRem(SDNode *Node) {
4720
4720
SDValue Op0 = Node->getOperand(0);
4721
4721
SDValue Op1 = Node->getOperand(1);
4722
4722
SDValue combined;
4723
- for (SDNode *User : Op0->uses ()) {
4723
+ for (SDNode *User : Op0->users ()) {
4724
4724
if (User == Node || User->getOpcode() == ISD::DELETED_NODE ||
4725
4725
User->use_empty())
4726
4726
continue;
@@ -10369,7 +10369,7 @@ static SDValue combineShiftToMULH(SDNode *N, const SDLoc &DL, SelectionDAG &DAG,
10369
10369
unsigned MulLoHiOp = IsSignExt ? ISD::SMUL_LOHI : ISD::UMUL_LOHI;
10370
10370
if (!ShiftOperand.hasOneUse() &&
10371
10371
TLI.isOperationLegalOrCustom(MulLoHiOp, NarrowVT) &&
10372
- llvm::any_of(ShiftOperand->uses (), UserOfLowerBits)) {
10372
+ llvm::any_of(ShiftOperand->users (), UserOfLowerBits)) {
10373
10373
return SDValue();
10374
10374
}
10375
10375
@@ -13570,7 +13570,7 @@ static SDValue tryToFoldExtOfLoad(SelectionDAG &DAG, DAGCombiner &Combiner,
13570
13570
if (NonNegZExt) {
13571
13571
assert(ExtLoadType == ISD::ZEXTLOAD && ExtOpc == ISD::ZERO_EXTEND &&
13572
13572
"Unexpected load type or opcode");
13573
- for (SDNode *User : N0->uses ()) {
13573
+ for (SDNode *User : N0->users ()) {
13574
13574
if (User->getOpcode() == ISD::SETCC) {
13575
13575
ISD::CondCode CC = cast<CondCodeSDNode>(User->getOperand(2))->get();
13576
13576
if (ISD::isSignedIntSetCC(CC)) {
@@ -17673,7 +17673,7 @@ SDValue DAGCombiner::combineRepeatedFPDivisors(SDNode *N) {
17673
17673
// Find all FDIV users of the same divisor.
17674
17674
// Use a set because duplicates may be present in the user list.
17675
17675
SetVector<SDNode *> Users;
17676
- for (auto *U : N1->uses ()) {
17676
+ for (auto *U : N1->users ()) {
17677
17677
if (U->getOpcode() == ISD::FDIV && U->getOperand(1) == N1) {
17678
17678
// Skip X/sqrt(X) that has not been simplified to sqrt(X) yet.
17679
17679
if (U->getOperand(1).getOpcode() == ISD::FSQRT &&
@@ -18965,15 +18965,15 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
18965
18965
// Now check for #3 and #4.
18966
18966
bool RealUse = false;
18967
18967
18968
- for (SDNode *Use : Ptr->uses ()) {
18969
- if (Use == N)
18968
+ for (SDNode *User : Ptr->users ()) {
18969
+ if (User == N)
18970
18970
continue;
18971
- if (SDNode::hasPredecessorHelper(Use , Visited, Worklist, MaxSteps))
18971
+ if (SDNode::hasPredecessorHelper(User , Visited, Worklist, MaxSteps))
18972
18972
return false;
18973
18973
18974
18974
// If Ptr may be folded in addressing mode of other use, then it's
18975
18975
// not profitable to do this transformation.
18976
- if (!canFoldInAddressingMode(Ptr.getNode(), Use , DAG, TLI))
18976
+ if (!canFoldInAddressingMode(Ptr.getNode(), User , DAG, TLI))
18977
18977
RealUse = true;
18978
18978
}
18979
18979
@@ -19089,29 +19089,29 @@ static bool shouldCombineToPostInc(SDNode *N, SDValue Ptr, SDNode *PtrUse,
19089
19089
19090
19090
SmallPtrSet<const SDNode *, 32> Visited;
19091
19091
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())
19094
19094
continue;
19095
19095
19096
19096
// No if there's a later user which could perform the index instead.
19097
- if (isa<MemSDNode>(Use )) {
19097
+ if (isa<MemSDNode>(User )) {
19098
19098
bool IsLoad = true;
19099
19099
bool IsMasked = false;
19100
19100
SDValue OtherPtr;
19101
- if (getCombineLoadStoreParts(Use , ISD::POST_INC, ISD::POST_DEC, IsLoad,
19101
+ if (getCombineLoadStoreParts(User , ISD::POST_INC, ISD::POST_DEC, IsLoad,
19102
19102
IsMasked, OtherPtr, TLI)) {
19103
19103
SmallVector<const SDNode *, 2> Worklist;
19104
- Worklist.push_back(Use );
19104
+ Worklist.push_back(User );
19105
19105
if (SDNode::hasPredecessorHelper(N, Visited, Worklist, MaxSteps))
19106
19106
return false;
19107
19107
}
19108
19108
}
19109
19109
19110
19110
// If all the uses are load / store addresses, then don't do the
19111
19111
// 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))
19115
19115
return false;
19116
19116
}
19117
19117
}
@@ -19136,7 +19136,7 @@ static SDNode *getPostIndexedLoadStoreOp(SDNode *N, bool &IsLoad,
19136
19136
// nor a successor of N. Otherwise, if Op is folded that would
19137
19137
// create a cycle.
19138
19138
unsigned MaxSteps = SelectionDAG::getHasPredecessorMaxSteps();
19139
- for (SDNode *Op : Ptr->uses ()) {
19139
+ for (SDNode *Op : Ptr->users ()) {
19140
19140
// Check for #1.
19141
19141
if (!shouldCombineToPostInc(N, Ptr, Op, BasePtr, Offset, AM, DAG, TLI))
19142
19142
continue;
@@ -20515,24 +20515,24 @@ bool DAGCombiner::isMulAddWithConstProfitable(SDNode *MulNode, SDValue AddNode,
20515
20515
return true;
20516
20516
20517
20517
// 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.
20520
20520
continue;
20521
20521
20522
- if (Use ->getOpcode() == ISD::MUL) { // We have another multiply use.
20522
+ if (User ->getOpcode() == ISD::MUL) { // We have another multiply use.
20523
20523
SDNode *OtherOp;
20524
20524
SDNode *MulVar = AddNode.getOperand(0).getNode();
20525
20525
20526
20526
// 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();
20529
20529
else
20530
- OtherOp = Use ->getOperand(0).getNode();
20530
+ OtherOp = User ->getOperand(0).getNode();
20531
20531
20532
20532
// Check to see if multiply is with the same operand of our "add".
20533
20533
//
20534
20534
// ConstNode = CONST
20535
- // Use = ConstNode * A <-- visiting Use . OtherOp is A.
20535
+ // User = ConstNode * A <-- visiting User . OtherOp is A.
20536
20536
// ...
20537
20537
// AddNode = (A + c1) <-- MulVar is A.
20538
20538
// = AddNode * ConstNode <-- current visiting instruction.
@@ -20550,7 +20550,7 @@ bool DAGCombiner::isMulAddWithConstProfitable(SDNode *MulNode, SDValue AddNode,
20550
20550
// ... = AddNode * ConstNode <-- current visiting instruction.
20551
20551
// ...
20552
20552
// OtherOp = (A + c2)
20553
- // Use = OtherOp * ConstNode <-- visiting Use .
20553
+ // User = OtherOp * ConstNode <-- visiting User .
20554
20554
//
20555
20555
// If we make this transformation, we will have a common
20556
20556
// multiply (CONST * A) after we also do the same transformation
@@ -22902,7 +22902,7 @@ bool DAGCombiner::refineExtractVectorEltIntoMultipleNarrowExtractVectorElts(
22902
22902
// Did we fail to model any of the users of the Producer?
22903
22903
bool ProducerIsLeaf = false;
22904
22904
// Look at each user of this Producer.
22905
- for (SDNode *User : E.Producer->uses ()) {
22905
+ for (SDNode *User : E.Producer->users ()) {
22906
22906
switch (User->getOpcode()) {
22907
22907
// TODO: support ISD::BITCAST
22908
22908
// TODO: support ISD::ANY_EXTEND
@@ -23176,14 +23176,14 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
23176
23176
23177
23177
// If only EXTRACT_VECTOR_ELT nodes use the source vector we can
23178
23178
// 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) {
23180
23180
return Use->getOpcode() == ISD::EXTRACT_VECTOR_ELT &&
23181
23181
Use->getOperand(0) == VecOp &&
23182
23182
isa<ConstantSDNode>(Use->getOperand(1));
23183
23183
})) {
23184
23184
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));
23187
23187
if (CstElt->getAPIntValue().ult(NumElts))
23188
23188
DemandedElts.setBit(CstElt->getZExtValue());
23189
23189
}
@@ -27302,7 +27302,7 @@ SDValue DAGCombiner::visitGET_FPENV_MEM(SDNode *N) {
27302
27302
// Check if the memory, where FP state is written to, is used only in a single
27303
27303
// load operation.
27304
27304
LoadSDNode *LdNode = nullptr;
27305
- for (auto *U : Ptr->uses ()) {
27305
+ for (auto *U : Ptr->users ()) {
27306
27306
if (U == N)
27307
27307
continue;
27308
27308
if (auto *Ld = dyn_cast<LoadSDNode>(U)) {
@@ -27352,7 +27352,7 @@ SDValue DAGCombiner::visitSET_FPENV_MEM(SDNode *N) {
27352
27352
27353
27353
// Check if the address of FP state is used also in a store operation only.
27354
27354
StoreSDNode *StNode = nullptr;
27355
- for (auto *U : Ptr->uses ()) {
27355
+ for (auto *U : Ptr->users ()) {
27356
27356
if (U == N)
27357
27357
continue;
27358
27358
if (auto *St = dyn_cast<StoreSDNode>(U)) {
0 commit comments