Skip to content

Commit e4847a7

Browse files
Revert "[Target] Use llvm::append_range (NFC)"
This reverts commit cc7a238. The X86WinEHState.cpp hunk seems to break certain builds.
1 parent 99d5fad commit e4847a7

12 files changed

+44
-22
lines changed

llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ recursivelyVisitUsers(GlobalValue &GV,
8181
continue;
8282
}
8383

84-
append_range(Stack, U->users());
84+
for (User *UU : U->users())
85+
Stack.push_back(UU);
8586
}
8687
}
8788

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6208,10 +6208,12 @@ SDValue SITargetLowering::lowerImage(SDValue Op,
62086208
SmallVector<SDValue, 26> Ops;
62096209
if (BaseOpcode->Store || BaseOpcode->Atomic)
62106210
Ops.push_back(VData); // vdata
6211-
if (UseNSA)
6212-
append_range(Ops, VAddrs);
6213-
else
6211+
if (UseNSA) {
6212+
for (const SDValue &Addr : VAddrs)
6213+
Ops.push_back(Addr);
6214+
} else {
62146215
Ops.push_back(VAddr);
6216+
}
62156217
Ops.push_back(Op.getOperand(ArgOffset + Intr->RsrcIndex));
62166218
if (BaseOpcode->Sampler)
62176219
Ops.push_back(Op.getOperand(ArgOffset + Intr->SampIndex));

llvm/lib/Target/AMDGPU/SILowerI1Copies.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ class PhiIncomingAnalysis {
177177
}
178178
}
179179

180-
if (Divergent && PDT.dominates(&DefBlock, MBB))
181-
append_range(Stack, MBB->successors());
180+
if (Divergent && PDT.dominates(&DefBlock, MBB)) {
181+
for (MachineBasicBlock *Succ : MBB->successors())
182+
Stack.push_back(Succ);
183+
}
182184
}
183185

184186
while (!Stack.empty()) {
@@ -187,7 +189,8 @@ class PhiIncomingAnalysis {
187189
continue;
188190
ReachableOrdered.push_back(MBB);
189191

190-
append_range(Stack, MBB->successors());
192+
for (MachineBasicBlock *Succ : MBB->successors())
193+
Stack.push_back(Succ);
191194
}
192195

193196
for (MachineBasicBlock *MBB : ReachableOrdered) {

llvm/lib/Target/ARM/ARMISelLowering.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3556,7 +3556,8 @@ static bool allUsersAreInFunction(const Value *V, const Function *F) {
35563556
while (!Worklist.empty()) {
35573557
auto *U = Worklist.pop_back_val();
35583558
if (isa<ConstantExpr>(U)) {
3559-
append_range(Worklist, U->users());
3559+
for (auto *UU : U->users())
3560+
Worklist.push_back(UU);
35603561
continue;
35613562
}
35623563

@@ -19125,7 +19126,8 @@ bool ARMTargetLowering::lowerInterleavedStore(StoreInst *SI,
1912519126

1912619127
SmallVector<Value *, 6> Ops;
1912719128
Ops.push_back(Builder.CreateBitCast(BaseAddr, Int8Ptr));
19128-
append_range(Ops, Shuffles);
19129+
for (auto S : Shuffles)
19130+
Ops.push_back(S);
1912919131
Ops.push_back(Builder.getInt32(SI->getAlignment()));
1913019132
Builder.CreateCall(VstNFunc, Ops);
1913119133
} else {
@@ -19141,7 +19143,8 @@ bool ARMTargetLowering::lowerInterleavedStore(StoreInst *SI,
1914119143

1914219144
SmallVector<Value *, 6> Ops;
1914319145
Ops.push_back(Builder.CreateBitCast(BaseAddr, EltPtrTy));
19144-
append_range(Ops, Shuffles);
19146+
for (auto S : Shuffles)
19147+
Ops.push_back(S);
1914519148
for (unsigned F = 0; F < Factor; F++) {
1914619149
Ops.push_back(Builder.getInt32(F));
1914719150
Builder.CreateCall(VstNFunc, Ops);

llvm/lib/Target/ARM/ARMLowOverheadLoops.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ namespace {
143143
// Insert exit blocks.
144144
SmallVector<MachineBasicBlock*, 2> ExitBlocks;
145145
ML.getExitBlocks(ExitBlocks);
146-
append_range(Order, ExitBlocks);
146+
for (auto *MBB : ExitBlocks)
147+
Order.push_back(MBB);
147148

148149
// Then add the loop body.
149150
Search(ML.getHeader());

llvm/lib/Target/ARM/ARMParallelDSP.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ namespace {
202202
public:
203203
WidenedLoad(SmallVectorImpl<LoadInst*> &Lds, LoadInst *Wide)
204204
: NewLd(Wide) {
205-
append_range(Loads, Lds);
205+
for (auto *I : Lds)
206+
Loads.push_back(I);
206207
}
207208
LoadInst *getLoad() {
208209
return NewLd;

llvm/lib/Target/Hexagon/HexagonISelLoweringHVX.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,8 @@ HexagonTargetLowering::getInt(unsigned IntId, MVT ResTy, ArrayRef<SDValue> Ops,
315315
const SDLoc &dl, SelectionDAG &DAG) const {
316316
SmallVector<SDValue,4> IntOps;
317317
IntOps.push_back(DAG.getConstant(IntId, dl, MVT::i32));
318-
append_range(IntOps, Ops);
318+
for (const SDValue &Op : Ops)
319+
IntOps.push_back(Op);
319320
return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, dl, ResTy, IntOps);
320321
}
321322

llvm/lib/Target/Hexagon/HexagonSplitDouble.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -574,9 +574,12 @@ void HexagonSplitDoubleRegs::collectIndRegs(LoopRegMap &IRM) {
574574

575575
LoopVector WorkQ;
576576

577-
append_range(WorkQ, *MLI);
578-
for (unsigned i = 0; i < WorkQ.size(); ++i)
579-
append_range(WorkQ, *WorkQ[i]);
577+
for (auto I : *MLI)
578+
WorkQ.push_back(I);
579+
for (unsigned i = 0; i < WorkQ.size(); ++i) {
580+
for (auto I : *WorkQ[i])
581+
WorkQ.push_back(I);
582+
}
580583

581584
USet Rs;
582585
for (unsigned i = 0, n = WorkQ.size(); i < n; ++i) {

llvm/lib/Target/Hexagon/RDFDeadCode.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,8 @@ bool DeadCodeElimination::erase(const SetVector<NodeId> &Nodes) {
195195
// If it's a code node, add all ref nodes from it.
196196
uint16_t Kind = BA.Addr->getKind();
197197
if (Kind == NodeAttrs::Stmt || Kind == NodeAttrs::Phi) {
198-
append_range(DRNs, NodeAddr<CodeNode*>(BA).Addr->members(DFG));
198+
for (auto N : NodeAddr<CodeNode*>(BA).Addr->members(DFG))
199+
DRNs.push_back(N);
199200
DINs.push_back(DFG.addr<InstrNode*>(I));
200201
} else {
201202
llvm_unreachable("Unexpected code node");

llvm/lib/Target/PowerPC/PPCCTRLoops.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ static bool verifyCTRBranch(MachineBasicBlock *MBB,
148148
return false;
149149
}
150150

151-
append_range(Preds, MBB->predecessors());
151+
for (MachineBasicBlock::pred_iterator PI = MBB->pred_begin(),
152+
PIE = MBB->pred_end(); PI != PIE; ++PI)
153+
Preds.push_back(*PI);
152154
}
153155

154156
do {

llvm/lib/Target/X86/X86PartialReduction.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,8 @@ static void collectLeaves(Value *Root, SmallVectorImpl<Instruction *> &Leaves) {
392392
break;
393393

394394
// Push incoming values to the worklist.
395-
append_range(Worklist, PN->incoming_values());
395+
for (Value *InV : PN->incoming_values())
396+
Worklist.push_back(InV);
396397

397398
continue;
398399
}
@@ -401,7 +402,8 @@ static void collectLeaves(Value *Root, SmallVectorImpl<Instruction *> &Leaves) {
401402
if (BO->getOpcode() == Instruction::Add) {
402403
// Simple case. Single use, just push its operands to the worklist.
403404
if (BO->hasNUses(BO == Root ? 2 : 1)) {
404-
append_range(Worklist, BO->operands());
405+
for (Value *Op : BO->operands())
406+
Worklist.push_back(Op);
405407
continue;
406408
}
407409

@@ -424,7 +426,8 @@ static void collectLeaves(Value *Root, SmallVectorImpl<Instruction *> &Leaves) {
424426
continue;
425427

426428
// The phi forms a loop with this Add, push its operands.
427-
append_range(Worklist, BO->operands());
429+
for (Value *Op : BO->operands())
430+
Worklist.push_back(Op);
428431
}
429432
}
430433
}

llvm/lib/Target/X86/X86WinEHState.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,8 @@ void WinEHStatePass::addStateStores(Function &F, WinEHFuncInfo &FuncInfo) {
704704
// enqueue it's successors to see if we can infer their states.
705705
InitialStates.insert({BB, PredState});
706706
FinalStates.insert({BB, PredState});
707-
append_range(Worklist, successors(BB));
707+
for (BasicBlock *SuccBB : successors(BB))
708+
Worklist.push_back(SuccBB);
708709
}
709710

710711
// Try to hoist stores from successors.

0 commit comments

Comments
 (0)