Skip to content

Commit 085cb29

Browse files
committed
fixup! Rename variables Use->User. Fix M68k use.
1 parent 582d1bf commit 085cb29

File tree

5 files changed

+42
-42
lines changed

5 files changed

+42
-42
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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->users()) {
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->users()) {
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->users())
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
}
@@ -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->users()) {
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
@@ -23182,8 +23182,8 @@ SDValue DAGCombiner::visitEXTRACT_VECTOR_ELT(SDNode *N) {
2318223182
isa<ConstantSDNode>(Use->getOperand(1));
2318323183
})) {
2318423184
APInt DemandedElts = APInt::getZero(NumElts);
23185-
for (SDNode *Use : VecOp->users()) {
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
}

llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,15 +1012,15 @@ bool AArch64DAGToDAGISel::SelectArithUXTXRegister(SDValue N, SDValue &Reg,
10121012
/// a single pseudo-instruction for an ADRP/ADD pair so over-aggressive folding
10131013
/// leads to duplicated ADRP instructions.
10141014
static bool isWorthFoldingADDlow(SDValue N) {
1015-
for (auto *Use : N->users()) {
1016-
if (Use->getOpcode() != ISD::LOAD && Use->getOpcode() != ISD::STORE &&
1017-
Use->getOpcode() != ISD::ATOMIC_LOAD &&
1018-
Use->getOpcode() != ISD::ATOMIC_STORE)
1015+
for (auto *User : N->users()) {
1016+
if (User->getOpcode() != ISD::LOAD && User->getOpcode() != ISD::STORE &&
1017+
User->getOpcode() != ISD::ATOMIC_LOAD &&
1018+
User->getOpcode() != ISD::ATOMIC_STORE)
10191019
return false;
10201020

10211021
// ldar and stlr have much more restrictive addressing modes (just a
10221022
// register).
1023-
if (isStrongerThanMonotonic(cast<MemSDNode>(Use)->getSuccessOrdering()))
1023+
if (isStrongerThanMonotonic(cast<MemSDNode>(User)->getSuccessOrdering()))
10241024
return false;
10251025
}
10261026

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12544,15 +12544,15 @@ SDValue SITargetLowering::performOrCombine(SDNode *N,
1254412544
return true;
1254512545

1254612546
// If we have any non-vectorized use, then it is a candidate for v_perm
12547-
for (auto *VUse : OrUse->users()) {
12548-
if (!VUse->getValueType(0).isVector())
12547+
for (auto *VUser : OrUse->users()) {
12548+
if (!VUser->getValueType(0).isVector())
1254912549
return true;
1255012550

1255112551
// If the use of a vector is a store, then combining via a v_perm
1255212552
// is beneficial.
1255312553
// TODO -- whitelist more uses
1255412554
for (auto VectorwiseOp : {ISD::STORE, ISD::CopyToReg, ISD::CopyFromReg})
12555-
if (VUse->getOpcode() == VectorwiseOp)
12555+
if (VUser->getOpcode() == VectorwiseOp)
1255612556
return true;
1255712557
}
1255812558
return false;
@@ -13895,10 +13895,10 @@ SDValue SITargetLowering::tryFoldToMad64_32(SDNode *N,
1389513895
// part of full-rate 64-bit ops).
1389613896
if (!Subtarget->hasFullRate64Ops()) {
1389713897
unsigned NumUsers = 0;
13898-
for (SDNode *Use : LHS->users()) {
13898+
for (SDNode *User : LHS->users()) {
1389913899
// There is a use that does not feed into addition, so the multiply can't
1390013900
// be removed. We prefer MUL + ADD + ADDC over MAD + MUL.
13901-
if (Use->getOpcode() != ISD::ADD)
13901+
if (User->getOpcode() != ISD::ADD)
1390213902
return SDValue();
1390313903

1390413904
// We prefer 2xMAD over MUL + 2xADD + 2xADDC (code density), and prefer

llvm/lib/Target/M68k/M68kISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1990,7 +1990,7 @@ SDValue M68kTargetLowering::EmitTest(SDValue Op, unsigned M68kCC,
19901990
case ISD::XOR:
19911991
// Due to the ISEL shortcoming noted above, be conservative if this op is
19921992
// likely to be selected as part of a load-modify-store instruction.
1993-
for (const auto *U : Op.getNode()->uses())
1993+
for (const auto *U : Op.getNode()->users())
19941994
if (U->getOpcode() == ISD::STORE)
19951995
goto default_case;
19961996

llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,21 +2614,21 @@ static bool selectConstantAddr(SelectionDAG *CurDAG, const SDLoc &DL,
26142614
// Is this ADD instruction only used as the base pointer of scalar loads and
26152615
// stores?
26162616
static bool isWorthFoldingAdd(SDValue Add) {
2617-
for (auto *Use : Add->users()) {
2618-
if (Use->getOpcode() != ISD::LOAD && Use->getOpcode() != ISD::STORE &&
2619-
Use->getOpcode() != ISD::ATOMIC_LOAD &&
2620-
Use->getOpcode() != ISD::ATOMIC_STORE)
2617+
for (auto *User : Add->users()) {
2618+
if (User->getOpcode() != ISD::LOAD && User->getOpcode() != ISD::STORE &&
2619+
User->getOpcode() != ISD::ATOMIC_LOAD &&
2620+
User->getOpcode() != ISD::ATOMIC_STORE)
26212621
return false;
2622-
EVT VT = cast<MemSDNode>(Use)->getMemoryVT();
2622+
EVT VT = cast<MemSDNode>(User)->getMemoryVT();
26232623
if (!VT.isScalarInteger() && VT != MVT::f16 && VT != MVT::f32 &&
26242624
VT != MVT::f64)
26252625
return false;
26262626
// Don't allow stores of the value. It must be used as the address.
2627-
if (Use->getOpcode() == ISD::STORE &&
2628-
cast<StoreSDNode>(Use)->getValue() == Add)
2627+
if (User->getOpcode() == ISD::STORE &&
2628+
cast<StoreSDNode>(User)->getValue() == Add)
26292629
return false;
2630-
if (Use->getOpcode() == ISD::ATOMIC_STORE &&
2631-
cast<AtomicSDNode>(Use)->getVal() == Add)
2630+
if (User->getOpcode() == ISD::ATOMIC_STORE &&
2631+
cast<AtomicSDNode>(User)->getVal() == Add)
26322632
return false;
26332633
}
26342634

0 commit comments

Comments
 (0)