[llvm] [PatternMatch] Introduce match functor (NFC) (PR #159386)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 17 08:58:08 PDT 2025


================
@@ -1340,7 +1340,7 @@ Instruction *InstCombinerImpl::foldICmpWithConstant(ICmpInst &Cmp) {
     return nullptr;
 
   if (auto *Phi = dyn_cast<PHINode>(Op0))
-    if (all_of(Phi->operands(), [](Value *V) { return isa<Constant>(V); })) {
+    if (all_of(Phi->operands(), match_fn(m_Constant()))) {
----------------
nikic wrote:

Do we prefer `match_fn(m_Constant())` over `IsaPred<Constant>`?

https://github.com/llvm/llvm-project/pull/159386


More information about the llvm-commits mailing list