Skip to content

Conversation

kazutakahirata
Copy link
Contributor

@kazutakahirata kazutakahirata commented Jun 7, 2025

While I am at it, this patch replaces It with std::next(It) for clarity.

Note that It is not used after this point.

@llvmbot
Copy link
Member

llvmbot commented Jun 7, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/143282.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Scalar/LICM.cpp (+1-2)
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 7965ed76a81b7..d11b4c5ee244a 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -786,8 +786,7 @@ class ControlFlowHoister {
       return InitialPreheader;
     }
     BranchInst *BI = It->first;
-    assert(std::find_if(++It, HoistableBranches.end(), HasBBAsSuccessor) ==
-               HoistableBranches.end() &&
+    assert(std::none_of(++It, HoistableBranches.end(), HasBBAsSuccessor) &&
            "BB is expected to be the target of at most one branch");
 
     LLVMContext &C = BB->getContext();

@kazutakahirata kazutakahirata merged commit 3e1931d into llvm:main Jun 8, 2025
7 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250607_std_none_of_llvm branch June 8, 2025 08:34
tomtor pushed a commit to tomtor/llvm-project that referenced this pull request Jun 14, 2025
While I am at it, this patch replaces It with std::next(It) for clarity.

Note that It is not used after this point.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants