mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 02:33:06 +01:00
[llvm] Use the default value of drop_begin (NFC)
This commit is contained in:
parent
32a3ef3ebc
commit
8b4d487fa2
@ -567,7 +567,7 @@ bool Loop::isAnnotatedParallel() const {
|
||||
SmallPtrSet<MDNode *, 4>
|
||||
ParallelAccessGroups; // For scalable 'contains' check.
|
||||
if (ParallelAccesses) {
|
||||
for (const MDOperand &MD : drop_begin(ParallelAccesses->operands(), 1)) {
|
||||
for (const MDOperand &MD : drop_begin(ParallelAccesses->operands())) {
|
||||
MDNode *AccGroup = cast<MDNode>(MD.get());
|
||||
assert(isValidAsAccessGroup(AccGroup) &&
|
||||
"List item must be an access group");
|
||||
|
@ -145,7 +145,7 @@ static void addVCallToSet(DevirtCallSite Call, GlobalValue::GUID Guid,
|
||||
SetVector<FunctionSummary::ConstVCall> &ConstVCalls) {
|
||||
std::vector<uint64_t> Args;
|
||||
// Start from the second argument to skip the "this" pointer.
|
||||
for (auto &Arg : drop_begin(Call.CB.args(), 1)) {
|
||||
for (auto &Arg : drop_begin(Call.CB.args())) {
|
||||
auto *CI = dyn_cast<ConstantInt>(Arg);
|
||||
if (!CI || CI->getBitWidth() > 64) {
|
||||
VCalls.insert({Guid, Call.Offset});
|
||||
|
@ -3274,7 +3274,7 @@ const SCEV *ScalarEvolution::getUDivExactExpr(const SCEV *LHS,
|
||||
// first element of the mulexpr.
|
||||
if (const auto *LHSCst = dyn_cast<SCEVConstant>(Mul->getOperand(0))) {
|
||||
if (LHSCst == RHSCst) {
|
||||
SmallVector<const SCEV *, 2> Operands(drop_begin(Mul->operands(), 1));
|
||||
SmallVector<const SCEV *, 2> Operands(drop_begin(Mul->operands()));
|
||||
return getMulExpr(Operands);
|
||||
}
|
||||
|
||||
|
@ -290,7 +290,7 @@ bool verifyAllVectorsHaveSameWidth(FunctionType *Signature) {
|
||||
|
||||
assert(VecTys.size() > 1 && "Invalid number of elements.");
|
||||
const ElementCount EC = VecTys[0]->getElementCount();
|
||||
return llvm::all_of(llvm::drop_begin(VecTys, 1), [&EC](VectorType *VTy) {
|
||||
return llvm::all_of(llvm::drop_begin(VecTys), [&EC](VectorType *VTy) {
|
||||
return (EC == VTy->getElementCount());
|
||||
});
|
||||
}
|
||||
|
@ -661,7 +661,7 @@ bool CodeGenPrepare::eliminateFallThrough(Function &F) {
|
||||
// Use a temporary array to avoid iterator being invalidated when
|
||||
// deleting blocks.
|
||||
SmallVector<WeakTrackingVH, 16> Blocks;
|
||||
for (auto &Block : llvm::drop_begin(F, 1))
|
||||
for (auto &Block : llvm::drop_begin(F))
|
||||
Blocks.push_back(&Block);
|
||||
|
||||
SmallSet<WeakTrackingVH, 16> Preds;
|
||||
@ -747,7 +747,7 @@ bool CodeGenPrepare::eliminateMostlyEmptyBlocks(Function &F) {
|
||||
// as we remove them.
|
||||
// Note that this intentionally skips the entry block.
|
||||
SmallVector<WeakTrackingVH, 16> Blocks;
|
||||
for (auto &Block : llvm::drop_begin(F, 1))
|
||||
for (auto &Block : llvm::drop_begin(F))
|
||||
Blocks.push_back(&Block);
|
||||
|
||||
for (auto &Block : Blocks) {
|
||||
|
@ -140,7 +140,7 @@ void StackLayout::computeLayout() {
|
||||
|
||||
// Sort objects by size (largest first) to reduce fragmentation.
|
||||
if (StackObjects.size() > 2)
|
||||
llvm::stable_sort(drop_begin(StackObjects, 1),
|
||||
llvm::stable_sort(drop_begin(StackObjects),
|
||||
[](const StackObject &a, const StackObject &b) {
|
||||
return a.Size > b.Size;
|
||||
});
|
||||
|
@ -2194,7 +2194,7 @@ void SelectionDAGLegalize::ExpandFPLibCall(SDNode* Node,
|
||||
|
||||
if (Node->isStrictFPOpcode()) {
|
||||
EVT RetVT = Node->getValueType(0);
|
||||
SmallVector<SDValue, 4> Ops(drop_begin(Node->ops(), 1));
|
||||
SmallVector<SDValue, 4> Ops(drop_begin(Node->ops()));
|
||||
TargetLowering::MakeLibCallOptions CallOptions;
|
||||
// FIXME: This doesn't support tail calls.
|
||||
std::pair<SDValue, SDValue> Tmp = TLI.makeLibCall(DAG, LC, RetVT,
|
||||
|
@ -2854,7 +2854,7 @@ bool NVPTXDAGToDAGISel::tryTextureIntrinsic(SDNode *N) {
|
||||
}
|
||||
|
||||
// Copy over operands
|
||||
SmallVector<SDValue, 8> Ops(drop_begin(N->ops(), 1));
|
||||
SmallVector<SDValue, 8> Ops(drop_begin(N->ops()));
|
||||
Ops.push_back(N->getOperand(0)); // Move chain to the back.
|
||||
|
||||
ReplaceNode(N, CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops));
|
||||
@ -3363,7 +3363,7 @@ bool NVPTXDAGToDAGISel::trySurfaceIntrinsic(SDNode *N) {
|
||||
}
|
||||
|
||||
// Copy over operands
|
||||
SmallVector<SDValue, 8> Ops(drop_begin(N->ops(), 1));
|
||||
SmallVector<SDValue, 8> Ops(drop_begin(N->ops()));
|
||||
Ops.push_back(N->getOperand(0)); // Move chain to the back.
|
||||
|
||||
ReplaceNode(N, CurDAG->getMachineNode(Opc, SDLoc(N), N->getVTList(), Ops));
|
||||
|
@ -342,7 +342,7 @@ static bool isSafeToMove(const MachineOperand *Def, const MachineOperand *Use,
|
||||
// instruction in which the current value is used, we cannot
|
||||
// stackify. Stackifying in this case would require that def moving below the
|
||||
// current def in the stack, which cannot be achieved, even with locals.
|
||||
for (const auto &SubsequentDef : drop_begin(DefI->defs(), 1)) {
|
||||
for (const auto &SubsequentDef : drop_begin(DefI->defs())) {
|
||||
for (const auto &PriorUse : UseI->uses()) {
|
||||
if (&PriorUse == Use)
|
||||
break;
|
||||
@ -701,7 +701,7 @@ public:
|
||||
MachineOperand &pop() {
|
||||
RangeTy &Range = Worklist.back();
|
||||
MachineOperand &Op = *Range.begin();
|
||||
Range = drop_begin(Range, 1);
|
||||
Range = drop_begin(Range);
|
||||
if (Range.empty())
|
||||
Worklist.pop_back();
|
||||
assert((Worklist.empty() || !Worklist.back().empty()) &&
|
||||
|
@ -1710,7 +1710,7 @@ void X86AsmPrinter::LowerPATCHABLE_RET(const MachineInstr &MI,
|
||||
unsigned OpCode = MI.getOperand(0).getImm();
|
||||
MCInst Ret;
|
||||
Ret.setOpcode(OpCode);
|
||||
for (auto &MO : drop_begin(MI.operands(), 1))
|
||||
for (auto &MO : drop_begin(MI.operands()))
|
||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
||||
Ret.addOperand(MaybeOperand.getValue());
|
||||
OutStreamer->emitInstruction(Ret, getSubtargetInfo());
|
||||
@ -1749,7 +1749,7 @@ void X86AsmPrinter::LowerPATCHABLE_TAIL_CALL(const MachineInstr &MI,
|
||||
// Before emitting the instruction, add a comment to indicate that this is
|
||||
// indeed a tail call.
|
||||
OutStreamer->AddComment("TAILCALL");
|
||||
for (auto &MO : drop_begin(MI.operands(), 1))
|
||||
for (auto &MO : drop_begin(MI.operands()))
|
||||
if (auto MaybeOperand = MCIL.LowerMachineOperand(&MI, MO))
|
||||
TC.addOperand(MaybeOperand.getValue());
|
||||
OutStreamer->emitInstruction(TC, getSubtargetInfo());
|
||||
|
@ -739,7 +739,7 @@ private:
|
||||
<< ore::NV("OpenMPParallelMergeFront",
|
||||
MergableCIs.front()->getDebugLoc())
|
||||
<< " merged with parallel regions at ";
|
||||
for (auto *CI : llvm::drop_begin(MergableCIs, 1)) {
|
||||
for (auto *CI : llvm::drop_begin(MergableCIs)) {
|
||||
OR << ore::NV("OpenMPParallelMerge", CI->getDebugLoc());
|
||||
if (CI != MergableCIs.back())
|
||||
OR << ", ";
|
||||
|
@ -261,7 +261,7 @@ void splitAndWriteThinLTOBitcode(
|
||||
if (!RT || RT->getBitWidth() > 64 || F->arg_empty() ||
|
||||
!F->arg_begin()->use_empty())
|
||||
return;
|
||||
for (auto &Arg : drop_begin(F->args(), 1)) {
|
||||
for (auto &Arg : drop_begin(F->args())) {
|
||||
auto *ArgT = dyn_cast<IntegerType>(Arg.getType());
|
||||
if (!ArgT || ArgT->getBitWidth() > 64)
|
||||
return;
|
||||
|
@ -470,7 +470,7 @@ CallSiteInfo &VTableSlotInfo::findCallSiteInfo(CallBase &CB) {
|
||||
auto *CBType = dyn_cast<IntegerType>(CB.getType());
|
||||
if (!CBType || CBType->getBitWidth() > 64 || CB.arg_empty())
|
||||
return CSInfo;
|
||||
for (auto &&Arg : drop_begin(CB.args(), 1)) {
|
||||
for (auto &&Arg : drop_begin(CB.args())) {
|
||||
auto *CI = dyn_cast<ConstantInt>(Arg);
|
||||
if (!CI || CI->getBitWidth() > 64)
|
||||
return CSInfo;
|
||||
|
@ -1580,9 +1580,9 @@ bool LoopInterchangeTransform::adjustLoopBranches() {
|
||||
|
||||
// Now update the reduction PHIs in the inner and outer loop headers.
|
||||
SmallVector<PHINode *, 4> InnerLoopPHIs, OuterLoopPHIs;
|
||||
for (PHINode &PHI : drop_begin(InnerLoopHeader->phis(), 1))
|
||||
for (PHINode &PHI : drop_begin(InnerLoopHeader->phis()))
|
||||
InnerLoopPHIs.push_back(cast<PHINode>(&PHI));
|
||||
for (PHINode &PHI : drop_begin(OuterLoopHeader->phis(), 1))
|
||||
for (PHINode &PHI : drop_begin(OuterLoopHeader->phis()))
|
||||
OuterLoopPHIs.push_back(cast<PHINode>(&PHI));
|
||||
|
||||
auto &OuterInnerReductions = LIL.getOuterInnerReductions();
|
||||
|
@ -456,7 +456,7 @@ public:
|
||||
int Level = 0;
|
||||
OS << formatv("{0,-5} {1,-60} {2,+12} {3,+16}\n", "lvl", "function",
|
||||
"count", "sum");
|
||||
for (auto *F : reverse(drop_begin(CurrentStack, 1))) {
|
||||
for (auto *F : reverse(drop_begin(CurrentStack))) {
|
||||
auto Sum = std::accumulate(F->ExtraData.IntermediateDurations.begin(),
|
||||
F->ExtraData.IntermediateDurations.end(), 0LL);
|
||||
auto FuncId = FN.SymbolOrNumber(F->FuncId);
|
||||
|
Loading…
Reference in New Issue
Block a user