llvm.org GIT mirror llvm / 5d08e37
Use the range variant of remove_if instead of unpacking begin/end No functionality change is intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278475 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 3 years ago
22 changed file(s) with 139 addition(s) and 177 deletion(s). Raw diff Collapse all Expand all
146146 /// write it:
147147 ///
148148 /// \code
149 /// V.erase(std::remove_if(V.begin(), V.end(), P), V.end());
149 /// V.erase(remove_if(V, P), V.end());
150150 /// \endcode
151151 ///
152152 /// However, PriorityWorklist doesn't expose non-const iterators, making any
155155 /// \returns true if any element is removed.
156156 template
157157 bool erase_if(UnaryPredicate P) {
158 typename VectorT::iterator E = std::remove_if(
159 V.begin(), V.end(), TestAndEraseFromMap(P, M));
158 typename VectorT::iterator E =
159 remove_if(V, TestAndEraseFromMap(P, M));
160160 if (E == V.end())
161161 return false;
162162 for (auto I = V.begin(); I != E; ++I)
175175 /// write it:
176176 ///
177177 /// \code
178 /// V.erase(std::remove_if(V.begin(), V.end(), P), V.end());
178 /// V.erase(remove_if(V, P), V.end());
179179 /// \endcode
180180 ///
181181 /// However, SetVector doesn't expose non-const iterators, making any
184184 /// \returns true if any element is removed.
185185 template
186186 bool remove_if(UnaryPredicate P) {
187 typename vector_type::iterator I
188 = std::remove_if(vector_.begin(), vector_.end(),
189 TestAndEraseFromSet(P, set_));
187 typename vector_type::iterator I =
188 remove_if(vector_, TestAndEraseFromSet(P, set_));
190189 if (I == vector_.end())
191190 return false;
192191 vector_.erase(I, vector_.end());
91459145 }
91469146
91479147 // Remove all SCEVConstants.
9148 Terms.erase(std::remove_if(Terms.begin(), Terms.end(), [](const SCEV *E) {
9149 return isa(E);
9150 }),
9151 Terms.end());
9148 Terms.erase(
9149 remove_if(Terms, [](const SCEV *E) { return isa(E); }),
9150 Terms.end());
91529151
91539152 if (Terms.size() > 0)
91549153 if (!findArrayDimensionsRec(SE, Terms, Sizes))
570570 /// Also remove the value# from value# list.
571571 void LiveRange::removeValNo(VNInfo *ValNo) {
572572 if (empty()) return;
573 segments.erase(std::remove_if(begin(), end(), [ValNo](const Segment &S) {
573 segments.erase(remove_if(*this, [ValNo](const Segment &S) {
574574 return S.valno == ValNo;
575575 }), end());
576576 // Now that ValNo is dead, remove it.
789789 // worklist of already placed entries.
790790 // FIXME: If this shows up on profiles, it could be folded (at the cost of
791791 // some code complexity) into the loop below.
792 WorkList.erase(std::remove_if(WorkList.begin(), WorkList.end(),
793 [&](MachineBasicBlock *BB) {
794 return BlockToChain.lookup(BB) == &Chain;
795 }),
792 WorkList.erase(remove_if(WorkList,
793 [&](MachineBasicBlock *BB) {
794 return BlockToChain.lookup(BB) == &Chain;
795 }),
796796 WorkList.end());
797797
798798 if (WorkList.empty())
271271 }
272272
273273 LiveOuts.erase(
274 std::remove_if(LiveOuts.begin(), LiveOuts.end(),
275 [](const LiveOutReg &LO) { return LO.Reg == 0; }),
274 remove_if(LiveOuts, [](const LiveOutReg &LO) { return LO.Reg == 0; }),
276275 LiveOuts.end());
277276
278277 return LiveOuts;
195195
196196 // Remove all blocks which are now empty
197197 MemGroup.FreeMem.erase(
198 std::remove_if(MemGroup.FreeMem.begin(), MemGroup.FreeMem.end(),
199 [](FreeMemBlock &FreeMB) { return FreeMB.Free.size() == 0; }),
198 remove_if(MemGroup.FreeMem,
199 [](FreeMemBlock &FreeMB) { return FreeMB.Free.size() == 0; }),
200200 MemGroup.FreeMem.end());
201201
202202 return std::error_code();
997997 ///
998998 /// Erases all attachments matching the \c shouldRemove predicate.
999999 template void remove_if(PredTy shouldRemove) {
1000 Attachments.erase(
1001 std::remove_if(Attachments.begin(), Attachments.end(), shouldRemove),
1002 Attachments.end());
1000 Attachments.erase(remove_if(Attachments, shouldRemove), Attachments.end());
10031001 }
10041002 };
10051003
806806
807807 if (IsNewStructor)
808808 SrcElements.erase(
809 std::remove_if(SrcElements.begin(), SrcElements.end(),
810 [this](Constant *E) {
811 auto *Key = dyn_cast(
812 E->getAggregateElement(2)->stripPointerCasts());
813 if (!Key)
814 return false;
815 GlobalValue *DGV = getLinkedToGlobal(Key);
816 return !shouldLink(DGV, *Key);
817 }),
809 remove_if(SrcElements,
810 [this](Constant *E) {
811 auto *Key = dyn_cast(
812 E->getAggregateElement(2)->stripPointerCasts());
813 if (!Key)
814 return false;
815 GlobalValue *DGV = getLinkedToGlobal(Key);
816 return !shouldLink(DGV, *Key);
817 }),
818818 SrcElements.end());
819819 uint64_t NewSize = DstNumElements + SrcElements.size();
820820 ArrayType *NewType = ArrayType::get(EltTy, NewSize);
3838 }
3939
4040 void ArgList::eraseArg(OptSpecifier Id) {
41 Args.erase(std::remove_if(begin(), end(),
42 [=](Arg *A) { return A->getOption().matches(Id); }),
43 end());
41 Args.erase(
42 remove_if(*this, [=](Arg *A) { return A->getOption().matches(Id); }),
43 end());
4444 }
4545
4646 Arg *ArgList::getLastArgNoClaim(OptSpecifier Id) const {
11731173 StringRef Raw (String.data(), Third.getString().data() - String.data() +
11741174 Third.getString().size());
11751175 std::string Collapsed = Raw;
1176 Collapsed.erase(std::remove_if(Collapsed.begin(), Collapsed.end(), isspace),
1177 Collapsed.end());
1176 Collapsed.erase(remove_if(Collapsed, isspace), Collapsed.end());
11781177 StringRef Whole = Collapsed;
11791178 std::pair DotSplit = Whole.split('.');
11801179 if (!matchRegister(DotSplit.first.lower()))
12181217 NeededWorkaround = NeededWorkaround || (Again && !(Contigious && Type));
12191218 }
12201219 std::string Collapsed = RawString;
1221 Collapsed.erase(std::remove_if(Collapsed.begin(), Collapsed.end(), isspace),
1222 Collapsed.end());
1220 Collapsed.erase(remove_if(Collapsed, isspace), Collapsed.end());
12231221 StringRef FullString = Collapsed;
12241222 std::pair DotSplit = FullString.split('.');
12251223 unsigned DotReg = matchRegister(DotSplit.first.lower());
638638 // Node for removal.
639639 Erase.insert(*I);
640640 }
641 NodeVect::iterator NewE = std::remove_if(Nodes.begin(), Nodes.end(),
642 in_set(Erase));
641 NodeVect::iterator NewE = remove_if(Nodes, in_set(Erase));
643642 Nodes.resize(std::distance(Nodes.begin(), NewE));
644643
645644 DEBUG(dbgs() << "Gep nodes after post-commoning cleanup:\n" << Nodes);
397397 return S.start.isRegister() &&
398398 LocalImpDefs.count(LIS->getInstructionFromIndex(S.start));
399399 };
400 Range.segments.erase(std::remove_if(Range.begin(), Range.end(), StartImpDef),
401 Range.end());
400 Range.segments.erase(remove_if(Range, StartImpDef), Range.end());
402401 }
403402
404403 void HexagonExpandCondsets::updateDeadsInRange(unsigned Reg, LaneBitmask LM,
10511051 auto IsEmpty = [] (const IFRecordWithRegSet &IR) -> bool {
10521052 return IR.second.empty();
10531053 };
1054 auto End = std::remove_if(LL.begin(), LL.end(), IsEmpty);
1054 auto End = remove_if(LL, IsEmpty);
10551055 if (End != LL.end())
10561056 LL.erase(End, LL.end());
10571057 } else {
11431143 auto IsCopy = [] (const IFRecordWithRegSet &IR) -> bool {
11441144 return IR.first.Wdh == 32 && (IR.first.Off == 0 || IR.first.Off == 32);
11451145 };
1146 auto End = std::remove_if(LL.begin(), LL.end(), IsCopy);
1146 auto End = remove_if(LL, IsCopy);
11471147 if (End != LL.end())
11481148 LL.erase(End, LL.end());
11491149 }
509509 }
510510 return true;
511511 };
512 UVect::iterator End = std::remove_if(DP.begin(), DP.end(), NoIndOp);
512 UVect::iterator End = remove_if(DP, NoIndOp);
513513 Rs.insert(DP.begin(), End);
514514 Rs.insert(CmpR1);
515515 Rs.insert(CmpR2);
18851885 }
18861886
18871887 void eraseMatchingBitGroups(function_ref F) {
1888 BitGroups.erase(std::remove_if(BitGroups.begin(), BitGroups.end(), F),
1889 BitGroups.end());
1888 BitGroups.erase(remove_if(BitGroups, F), BitGroups.end());
18901889 }
18911890
18921891 SmallVector Bits;
204204 if (FTy->isVarArg())
205205 OS << "_...";
206206 Sig = OS.str();
207 Sig.erase(std::remove_if(Sig.begin(), Sig.end(), isspace), Sig.end());
207 Sig.erase(remove_if(Sig, isspace), Sig.end());
208208 // When s2wasm parses .s file, a comma means the end of an argument. So a
209209 // mangled function name can contain any character but a comma.
210210 std::replace(Sig.begin(), Sig.end(), ',', '.');
17391739 /// tests in ways which make them less useful in testing fused safepoints.
17401740 template static void unique_unsorted(SmallVectorImpl &Vec) {
17411741 SmallSet Seen;
1742 Vec.erase(std::remove_if(Vec.begin(), Vec.end(), [&](const T &V) {
1743 return !Seen.insert(V).second;
1744 }), Vec.end());
1742 Vec.erase(remove_if(Vec, [&](const T &V) { return !Seen.insert(V).second; }),
1743 Vec.end());
17451744 }
17461745
17471746 /// Insert holders so that each Value is obviously live through the entire
994994 return;
995995 }
996996
997 Slices.erase(std::remove_if(Slices.begin(), Slices.end(),
998 [](const Slice &S) {
999 return S.isDead();
1000 }),
997 Slices.erase(remove_if(Slices, [](const Slice &S) { return S.isDead(); }),
1001998 Slices.end());
1002999
10031000 #ifndef NDEBUG
18131810 // do that until all the backends are known to produce good code for all
18141811 // integer vector types.
18151812 if (!HaveCommonEltTy) {
1816 CandidateTys.erase(std::remove_if(CandidateTys.begin(), CandidateTys.end(),
1817 [](VectorType *VTy) {
1818 return !VTy->getElementType()->isIntegerTy();
1819 }),
1813 CandidateTys.erase(remove_if(CandidateTys,
1814 [](VectorType *VTy) {
1815 return !VTy->getElementType()->isIntegerTy();
1816 }),
18201817 CandidateTys.end());
18211818
18221819 // If there were no integer vector types, give up.
34603457 // match relative to their starting offset. We have to verify this prior to
34613458 // any rewriting.
34623459 Stores.erase(
3463 std::remove_if(Stores.begin(), Stores.end(),
3464 [&UnsplittableLoads, &SplitOffsetsMap](StoreInst *SI) {
3465 // Lookup the load we are storing in our map of split
3466 // offsets.
3467 auto *LI = cast(SI->getValueOperand());
3468 // If it was completely unsplittable, then we're done,
3469 // and this store can't be pre-split.
3470 if (UnsplittableLoads.count(LI))
3471 return true;
3472
3473 auto LoadOffsetsI = SplitOffsetsMap.find(LI);
3474 if (LoadOffsetsI == SplitOffsetsMap.end())
3475 return false; // Unrelated loads are definitely safe.
3476 auto &LoadOffsets = LoadOffsetsI->second;
3477
3478 // Now lookup the store's offsets.
3479 auto &StoreOffsets = SplitOffsetsMap[SI];
3480
3481 // If the relative offsets of each split in the load and
3482 // store match exactly, then we can split them and we
3483 // don't need to remove them here.
3484 if (LoadOffsets.Splits == StoreOffsets.Splits)
3485 return false;
3486
3487 DEBUG(dbgs()
3488 << " Mismatched splits for load and store:\n"
3489 << " " << *LI << "\n"
3490 << " " << *SI << "\n");
3491
3492 // We've found a store and load that we need to split
3493 // with mismatched relative splits. Just give up on them
3494 // and remove both instructions from our list of
3495 // candidates.
3496 UnsplittableLoads.insert(LI);
3497 return true;
3498 }),
3460 remove_if(Stores,
3461 [&UnsplittableLoads, &SplitOffsetsMap](StoreInst *SI) {
3462 // Lookup the load we are storing in our map of split
3463 // offsets.
3464 auto *LI = cast(SI->getValueOperand());
3465 // If it was completely unsplittable, then we're done,
3466 // and this store can't be pre-split.
3467 if (UnsplittableLoads.count(LI))
3468 return true;
3469
3470 auto LoadOffsetsI = SplitOffsetsMap.find(LI);
3471 if (LoadOffsetsI == SplitOffsetsMap.end())
3472 return false; // Unrelated loads are definitely safe.
3473 auto &LoadOffsets = LoadOffsetsI->second;
3474
3475 // Now lookup the store's offsets.
3476 auto &StoreOffsets = SplitOffsetsMap[SI];
3477
3478 // If the relative offsets of each split in the load and
3479 // store match exactly, then we can split them and we
3480 // don't need to remove them here.
3481 if (LoadOffsets.Splits == StoreOffsets.Splits)
3482 return false;
3483
3484 DEBUG(dbgs() << " Mismatched splits for load and store:\n"
3485 << " " << *LI << "\n"
3486 << " " << *SI << "\n");
3487
3488 // We've found a store and load that we need to split
3489 // with mismatched relative splits. Just give up on them
3490 // and remove both instructions from our list of
3491 // candidates.
3492 UnsplittableLoads.insert(LI);
3493 return true;
3494 }),
34993495 Stores.end());
35003496 // Now we have to go *back* through all the stores, because a later store may
35013497 // have caused an earlier store's load to become unsplittable and if it is
35023498 // unsplittable for the later store, then we can't rely on it being split in
35033499 // the earlier store either.
3504 Stores.erase(std::remove_if(Stores.begin(), Stores.end(),
3505 [&UnsplittableLoads](StoreInst *SI) {
3506 auto *LI =
3507 cast(SI->getValueOperand());
3508 return UnsplittableLoads.count(LI);
3509 }),
3500 Stores.erase(remove_if(Stores,
3501 [&UnsplittableLoads](StoreInst *SI) {
3502 auto *LI = cast(SI->getValueOperand());
3503 return UnsplittableLoads.count(LI);
3504 }),
35103505 Stores.end());
35113506 // Once we've established all the loads that can't be split for some reason,
35123507 // filter any that made it into our list out.
3513 Loads.erase(std::remove_if(Loads.begin(), Loads.end(),
3514 [&UnsplittableLoads](LoadInst *LI) {
3515 return UnsplittableLoads.count(LI);
3516 }),
3508 Loads.erase(remove_if(Loads,
3509 [&UnsplittableLoads](LoadInst *LI) {
3510 return UnsplittableLoads.count(LI);
3511 }),
35173512 Loads.end());
3518
35193513
35203514 // If no loads or stores are left, there is no pre-splitting to be done for
35213515 // this alloca.
37743768 }
37753769
37763770 // Remove the killed slices that have ben pre-split.
3777 AS.erase(std::remove_if(AS.begin(), AS.end(), [](const Slice &S) {
3778 return S.isDead();
3779 }), AS.end());
3771 AS.erase(remove_if(AS, [](const Slice &S) { return S.isDead(); }), AS.end());
37803772
37813773 // Insert our new slices. This will sort and merge them into the sorted
37823774 // sequence.
37913783 // Finally, don't try to promote any allocas that new require re-splitting.
37923784 // They have already been added to the worklist above.
37933785 PromotableAllocas.erase(
3794 std::remove_if(
3795 PromotableAllocas.begin(), PromotableAllocas.end(),
3786 remove_if(
3787 PromotableAllocas,
37963788 [&](AllocaInst *AI) { return ResplitPromotableAllocas.count(AI); }),
37973789 PromotableAllocas.end());
37983790
42274219 auto IsInSet = [&](AllocaInst *AI) { return DeletedAllocas.count(AI); };
42284220 Worklist.remove_if(IsInSet);
42294221 PostPromotionWorklist.remove_if(IsInSet);
4230 PromotableAllocas.erase(std::remove_if(PromotableAllocas.begin(),
4231 PromotableAllocas.end(),
4232 IsInSet),
4222 PromotableAllocas.erase(remove_if(PromotableAllocas, IsInSet),
42334223 PromotableAllocas.end());
42344224 DeletedAllocas.clear();
42354225 }
477477 // cases.
478478 assert(MaxPop > 0 && PopSucc);
479479 Default = PopSucc;
480 Cases.erase(std::remove_if(
481 Cases.begin(), Cases.end(),
482 [PopSucc](const CaseRange &R) { return R.BB == PopSucc; }),
483 Cases.end());
480 Cases.erase(
481 remove_if(Cases,
482 [PopSucc](const CaseRange &R) { return R.BB == PopSucc; }),
483 Cases.end());
484484
485485 // If there are no cases left, just branch.
486486 if (Cases.empty()) {
449449 }
450450
451451 // Okay, delete instructions with no operand info left.
452 auto I = std::remove_if(Instructions.begin(), Instructions.end(),
453 [](AsmWriterInst &Inst) {
454 return Inst.Operands.empty();
455 });
452 auto I = remove_if(Instructions,
453 [](AsmWriterInst &Inst) { return Inst.Operands.empty(); });
456454 Instructions.erase(I, Instructions.end());
457455
458456
238238 TypeSet InputSet(*this);
239239
240240 // Filter out all the fp types.
241 TypeVec.erase(std::remove_if(TypeVec.begin(), TypeVec.end(),
242 std::not1(std::ptr_fun(isInteger))),
241 TypeVec.erase(remove_if(TypeVec, std::not1(std::ptr_fun(isInteger))),
243242 TypeVec.end());
244243
245244 if (TypeVec.empty()) {
264263 TypeSet InputSet(*this);
265264
266265 // Filter out all the integer types.
267 TypeVec.erase(std::remove_if(TypeVec.begin(), TypeVec.end(),
268 std::not1(std::ptr_fun(isFloatingPoint))),
266 TypeVec.erase(remove_if(TypeVec, std::not1(std::ptr_fun(isFloatingPoint))),
269267 TypeVec.end());
270268
271269 if (TypeVec.empty()) {
291289 TypeSet InputSet(*this);
292290
293291 // Filter out all the vector types.
294 TypeVec.erase(std::remove_if(TypeVec.begin(), TypeVec.end(),
295 std::not1(std::ptr_fun(isScalar))),
292 TypeVec.erase(remove_if(TypeVec, std::not1(std::ptr_fun(isScalar))),
296293 TypeVec.end());
297294
298295 if (TypeVec.empty()) {
316313 bool MadeChange = false;
317314
318315 // Filter out all the scalar types.
319 TypeVec.erase(std::remove_if(TypeVec.begin(), TypeVec.end(),
320 std::not1(std::ptr_fun(isVector))),
316 TypeVec.erase(remove_if(TypeVec, std::not1(std::ptr_fun(isVector))),
321317 TypeVec.end());
322318
323319 if (TypeVec.empty()) {
394390 A.getSizeInBits() < B.getSizeInBits());
395391 });
396392
397 auto I = std::remove_if(Other.TypeVec.begin(), Other.TypeVec.end(),
398 [Smallest](MVT OtherVT) {
399 // Don't compare vector and non-vector types.
400 if (OtherVT.isVector() != Smallest.isVector())
401 return false;
402 // The getSizeInBits() check here is only needed for vectors, but is
403 // a subset of the scalar check for scalars so no need to qualify.
404 return OtherVT.getScalarSizeInBits() <= Smallest.getScalarSizeInBits()||
405 OtherVT.getSizeInBits() < Smallest.getSizeInBits();
406 });
393 auto I = remove_if(Other.TypeVec, [Smallest](MVT OtherVT) {
394 // Don't compare vector and non-vector types.
395 if (OtherVT.isVector() != Smallest.isVector())
396 return false;
397 // The getSizeInBits() check here is only needed for vectors, but is
398 // a subset of the scalar check for scalars so no need to qualify.
399 return OtherVT.getScalarSizeInBits() <= Smallest.getScalarSizeInBits() ||
400 OtherVT.getSizeInBits() < Smallest.getSizeInBits();
401 });
407402 MadeChange |= I != Other.TypeVec.end(); // If we're about to remove types.
408403 Other.TypeVec.erase(I, Other.TypeVec.end());
409404
427422 (A.getScalarSizeInBits() == B.getScalarSizeInBits() &&
428423 A.getSizeInBits() < B.getSizeInBits());
429424 });
430 auto I = std::remove_if(TypeVec.begin(), TypeVec.end(),
431 [Largest](MVT OtherVT) {
432 // Don't compare vector and non-vector types.
433 if (OtherVT.isVector() != Largest.isVector())
434 return false;
435 return OtherVT.getScalarSizeInBits() >= Largest.getScalarSizeInBits() ||
436 OtherVT.getSizeInBits() > Largest.getSizeInBits();
437 });
425 auto I = remove_if(TypeVec, [Largest](MVT OtherVT) {
426 // Don't compare vector and non-vector types.
427 if (OtherVT.isVector() != Largest.isVector())
428 return false;
429 return OtherVT.getScalarSizeInBits() >= Largest.getScalarSizeInBits() ||
430 OtherVT.getSizeInBits() > Largest.getSizeInBits();
431 });
438432 MadeChange |= I != TypeVec.end(); // If we're about to remove types.
439433 TypeVec.erase(I, TypeVec.end());
440434
459453 TypeSet InputSet(*this);
460454
461455 // Filter out all the types which don't have the right element type.
462 auto I = std::remove_if(TypeVec.begin(), TypeVec.end(),
463 [VT](MVT VVT) {
464 return VVT.getVectorElementType().SimpleTy != VT;
465 });
456 auto I = remove_if(TypeVec, [VT](MVT VVT) {
457 return VVT.getVectorElementType().SimpleTy != VT;
458 });
466459 MadeChange |= I != TypeVec.end();
467460 TypeVec.erase(I, TypeVec.end());
468461
546539 // Only keep types that have less elements than VTOperand.
547540 TypeSet InputSet(VTOperand);
548541
549 auto I = std::remove_if(VTOperand.TypeVec.begin(), VTOperand.TypeVec.end(),
550 [NumElems](MVT VVT) {
551 return VVT.getVectorNumElements() >= NumElems;
552 });
542 auto I = remove_if(VTOperand.TypeVec, [NumElems](MVT VVT) {
543 return VVT.getVectorNumElements() >= NumElems;
544 });
553545 MadeChange |= I != VTOperand.TypeVec.end();
554546 VTOperand.TypeVec.erase(I, VTOperand.TypeVec.end());
555547
570562 // Only keep types that have more elements than 'this'.
571563 TypeSet InputSet(*this);
572564
573 auto I = std::remove_if(TypeVec.begin(), TypeVec.end(),
574 [NumElems](MVT VVT) {
575 return VVT.getVectorNumElements() <= NumElems;
576 });
565 auto I = remove_if(TypeVec, [NumElems](MVT VVT) {
566 return VVT.getVectorNumElements() <= NumElems;
567 });
577568 MadeChange |= I != TypeVec.end();
578569 TypeVec.erase(I, TypeVec.end());
579570
608599 // Only keep types that have same elements as 'this'.
609600 TypeSet InputSet(VTOperand);
610601
611 auto I = std::remove_if(VTOperand.TypeVec.begin(), VTOperand.TypeVec.end(),
612 [NumElems](MVT VVT) {
613 return VVT.getVectorNumElements() != NumElems;
614 });
602 auto I = remove_if(VTOperand.TypeVec, [NumElems](MVT VVT) {
603 return VVT.getVectorNumElements() != NumElems;
604 });
615605 MadeChange |= I != VTOperand.TypeVec.end();
616606 VTOperand.TypeVec.erase(I, VTOperand.TypeVec.end());
617607
628618 // Only keep types that have same elements as VTOperand.
629619 TypeSet InputSet(*this);
630620
631 auto I = std::remove_if(TypeVec.begin(), TypeVec.end(),
632 [NumElems](MVT VVT) {
633 return VVT.getVectorNumElements() != NumElems;
634 });
621 auto I = remove_if(TypeVec, [NumElems](MVT VVT) {
622 return VVT.getVectorNumElements() != NumElems;
623 });
635624 MadeChange |= I != TypeVec.end();
636625 TypeVec.erase(I, TypeVec.end());
637626
662651 // Only keep types that have the same size as 'this'.
663652 TypeSet InputSet(VTOperand);
664653
665 auto I = std::remove_if(VTOperand.TypeVec.begin(), VTOperand.TypeVec.end(),
666 [&](MVT VT) {
667 return VT.getSizeInBits() != Size;
668 });
654 auto I = remove_if(VTOperand.TypeVec,
655 [&](MVT VT) { return VT.getSizeInBits() != Size; });
669656 MadeChange |= I != VTOperand.TypeVec.end();
670657 VTOperand.TypeVec.erase(I, VTOperand.TypeVec.end());
671658
682669 // Only keep types that have the same size as VTOperand.
683670 TypeSet InputSet(*this);
684671
685 auto I = std::remove_if(TypeVec.begin(), TypeVec.end(),
686 [&](MVT VT) {
687 return VT.getSizeInBits() != Size;
688 });
672 auto I =
673 remove_if(TypeVec, [&](MVT VT) { return VT.getSizeInBits() != Size; });
689674 MadeChange |= I != TypeVec.end();
690675 TypeVec.erase(I, TypeVec.end());
691676