[llvm] 3e1931d - [Scalar] Use std::none_of (NFC) (#143282)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 8 01:34:36 PDT 2025
Author: Kazu Hirata
Date: 2025-06-08T01:34:32-07:00
New Revision: 3e1931d7fea07b5cf5e4093c847382202af1e9b7
URL: https://github.com/llvm/llvm-project/commit/3e1931d7fea07b5cf5e4093c847382202af1e9b7
DIFF: https://github.com/llvm/llvm-project/commit/3e1931d7fea07b5cf5e4093c847382202af1e9b7.diff
LOG: [Scalar] Use std::none_of (NFC) (#143282)
While I am at it, this patch replaces It with std::next(It) for clarity.
Note that It is not used after this point.
Added:
Modified:
llvm/lib/Transforms/Scalar/LICM.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 7965ed76a81b7..9773ef778b690 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -786,8 +786,8 @@ class ControlFlowHoister {
return InitialPreheader;
}
BranchInst *BI = It->first;
- assert(std::find_if(++It, HoistableBranches.end(), HasBBAsSuccessor) ==
- HoistableBranches.end() &&
+ assert(std::none_of(std::next(It), HoistableBranches.end(),
+ HasBBAsSuccessor) &&
"BB is expected to be the target of at most one branch");
LLVMContext &C = BB->getContext();
More information about the llvm-commits
mailing list