diff options
author | Nikita Popov <npopov@redhat.com> | 2024-06-26 13:43:19 +0200 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2024-06-26 14:55:06 +0200 |
commit | d42b392696fbd9d612ac22ff82b4a1760fc26d89 (patch) | |
tree | 5969841a4c6f7b7c540469667eddef88b821845e /llvm/lib/Analysis/VectorUtils.cpp | |
parent | 177cbd16663a2ca36d0d7145c3b62f2d756f8f7f (diff) | |
download | llvm-d42b392696fbd9d612ac22ff82b4a1760fc26d89.zip llvm-d42b392696fbd9d612ac22ff82b4a1760fc26d89.tar.gz llvm-d42b392696fbd9d612ac22ff82b4a1760fc26d89.tar.bz2 |
[VectorUtils] Use SmallPtrSet::remove_if() (NFC)
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r-- | llvm/lib/Analysis/VectorUtils.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp index a83ce46..5f6758d 100644 --- a/llvm/lib/Analysis/VectorUtils.cpp +++ b/llvm/lib/Analysis/VectorUtils.cpp @@ -1481,20 +1481,19 @@ void InterleavedAccessInfo::invalidateGroupsRequiringScalarEpilogue() { if (!requiresScalarEpilogue()) return; - bool ReleasedGroup = false; // Release groups requiring scalar epilogues. Note that this also removes them // from InterleaveGroups. - for (auto *Group : make_early_inc_range(InterleaveGroups)) { + bool ReleasedGroup = InterleaveGroups.remove_if([&](auto *Group) { if (!Group->requiresScalarEpilogue()) - continue; + return false; LLVM_DEBUG( dbgs() << "LV: Invalidate candidate interleaved group due to gaps that " "require a scalar epilogue (not allowed under optsize) and cannot " "be masked (not enabled). \n"); - releaseGroup(Group); - ReleasedGroup = true; - } + releaseGroupWithoutRemovingFromSet(Group); + return true; + }); assert(ReleasedGroup && "At least one group must be invalidated, as a " "scalar epilogue was required"); (void)ReleasedGroup; |