diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 6 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/MachineSink.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/RegAllocGreedy.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectOptimize.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h | 3 | ||||
-rw-r--r-- | llvm/lib/CodeGen/WindowScheduler.cpp | 3 |
9 files changed, 10 insertions, 21 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index f8afb42..85a6d67 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -1477,8 +1477,7 @@ static uint64_t getOffsetFromIndices(const User &U, const DataLayout &DL) { for (auto Idx : IVI->indices()) Indices.push_back(ConstantInt::get(Int32Ty, Idx)); } else { - for (Value *Op : drop_begin(U.operands())) - Indices.push_back(Op); + llvm::append_range(Indices, drop_begin(U.operands())); } return 8 * static_cast<uint64_t>( @@ -2212,8 +2211,7 @@ bool IRTranslator::translateKnownIntrinsic(const CallInst &CI, Intrinsic::ID ID, case Intrinsic::fake_use: { SmallVector<llvm::SrcOp, 4> VRegs; for (const auto &Arg : CI.args()) - for (auto VReg : getOrCreateVRegs(*Arg)) - VRegs.push_back(VReg); + llvm::append_range(VRegs, getOrCreateVRegs(*Arg)); MIRBuilder.buildInstr(TargetOpcode::FAKE_USE, {}, VRegs); MF->setHasFakeUses(true); return true; diff --git a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp index c28f3c5..ac68eb55 100644 --- a/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp @@ -4906,8 +4906,7 @@ LegalizerHelper::fewerElementsVectorMultiEltType( SmallVector<Register, 8> SplitPieces; extractVectorParts(MI.getReg(UseIdx), NumElts, SplitPieces, MIRBuilder, MRI); - for (auto Reg : SplitPieces) - InputOpsPieces[UseNo].push_back(Reg); + llvm::append_range(InputOpsPieces[UseNo], SplitPieces); } } diff --git a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp index 9f11ccf..c70c638 100644 --- a/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp @@ -4218,9 +4218,7 @@ std::optional<ValueIDNum> InstrRefBasedLDV::resolveDbgPHIsImpl( } // Sort PHIs to validate into RPO-order. - SmallVector<LDVSSAPhi *, 8> SortedPHIs; - for (auto &PHI : CreatedPHIs) - SortedPHIs.push_back(PHI); + SmallVector<LDVSSAPhi *, 8> SortedPHIs(CreatedPHIs); llvm::sort(SortedPHIs, [&](LDVSSAPhi *A, LDVSSAPhi *B) { return BBToOrder[&A->getParent()->BB] < BBToOrder[&B->getParent()->BB]; diff --git a/llvm/lib/CodeGen/MachineSink.cpp b/llvm/lib/CodeGen/MachineSink.cpp index 173193b..aa2987b 100644 --- a/llvm/lib/CodeGen/MachineSink.cpp +++ b/llvm/lib/CodeGen/MachineSink.cpp @@ -2326,8 +2326,7 @@ bool PostRAMachineSinking::tryToSinkCopy(MachineBasicBlock &CurBB, for (MCRegUnit Unit : TRI->regunits(MO.getReg())) { for (const auto &MIRegs : SeenDbgInstrs.lookup(Unit)) { auto &Regs = DbgValsToSinkMap[MIRegs.first]; - for (Register Reg : MIRegs.second) - Regs.push_back(Reg); + llvm::append_range(Regs, MIRegs.second); } } } diff --git a/llvm/lib/CodeGen/RegAllocGreedy.cpp b/llvm/lib/CodeGen/RegAllocGreedy.cpp index ac1e9fe..a5cd9fc 100644 --- a/llvm/lib/CodeGen/RegAllocGreedy.cpp +++ b/llvm/lib/CodeGen/RegAllocGreedy.cpp @@ -2195,8 +2195,7 @@ MCRegister RAGreedy::tryLastChanceRecoloring( if (tryRecoloringCandidates(RecoloringQueue, CurrentNewVRegs, FixedRegisters, RecolorStack, Depth)) { // Push the queued vregs into the main queue. - for (Register NewVReg : CurrentNewVRegs) - NewVRegs.push_back(NewVReg); + llvm::append_range(NewVRegs, CurrentNewVRegs); // Do not mess up with the global assignment process. // I.e., VirtReg must be unassigned. if (VRM->hasPhys(ThisVirtReg)) { diff --git a/llvm/lib/CodeGen/SelectOptimize.cpp b/llvm/lib/CodeGen/SelectOptimize.cpp index b35f765..00148b0 100644 --- a/llvm/lib/CodeGen/SelectOptimize.cpp +++ b/llvm/lib/CodeGen/SelectOptimize.cpp @@ -451,8 +451,7 @@ void SelectOptimizeImpl::optimizeSelectsInnerLoops(Function &F, SmallVector<Loop *, 4> Loops(LI->begin(), LI->end()); // Need to check size on each iteration as we accumulate child loops. for (unsigned long i = 0; i < Loops.size(); ++i) - for (Loop *ChildL : Loops[i]->getSubLoops()) - Loops.push_back(ChildL); + llvm::append_range(Loops, Loops[i]->getSubLoops()); for (Loop *L : Loops) { if (!L->isInnermost()) diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index 5182e41..4b7a912 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -1195,8 +1195,7 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, // Add rounding control registers as implicit def for function call. if (II.isCall() && MF->getFunction().hasFnAttribute(Attribute::StrictFP)) { ArrayRef<MCPhysReg> RCRegs = TLI->getRoundingControlRegisters(); - for (MCPhysReg Reg : RCRegs) - UsedRegs.push_back(Reg); + llvm::append_range(UsedRegs, RCRegs); } // Finally mark unused registers as dead. diff --git a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h index 4c6b3a5..1708687 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h +++ b/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h @@ -197,8 +197,7 @@ public: for (const SDDbgOperand &DbgOp : getLocationOps()) if (DbgOp.getKind() == SDDbgOperand::SDNODE) Dependencies.push_back(DbgOp.getSDNode()); - for (SDNode *Node : getAdditionalDependencies()) - Dependencies.push_back(Node); + llvm::append_range(Dependencies, getAdditionalDependencies()); return Dependencies; } diff --git a/llvm/lib/CodeGen/WindowScheduler.cpp b/llvm/lib/CodeGen/WindowScheduler.cpp index 78af631..95c86a9 100644 --- a/llvm/lib/CodeGen/WindowScheduler.cpp +++ b/llvm/lib/CodeGen/WindowScheduler.cpp @@ -283,8 +283,7 @@ void WindowScheduler::restoreMBB() { MI.eraseFromParent(); } // Restore MBB to the state before window scheduling. - for (auto *MI : OriMIs) - MBB->push_back(MI); + llvm::append_range(*MBB, OriMIs); updateLiveIntervals(); } |