[llvm] [SCCP] Directly call SCCPSolver::isOverdefined (NFC) (PR #143059)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 20:56:07 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/143059

We don't need a lambda here.


>From 22accb8b9de6704d60c6ec60882864fe9f6124dc Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 5 Jun 2025 10:42:10 -0700
Subject: [PATCH] [SCCP] Directly call SCCPSolver::isOverdefined (NFC)

We don't need a lambda here.
---
 llvm/lib/Transforms/IPO/SCCP.cpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/IPO/SCCP.cpp b/llvm/lib/Transforms/IPO/SCCP.cpp
index 9d15dd0c10388..43c5df3575003 100644
--- a/llvm/lib/Transforms/IPO/SCCP.cpp
+++ b/llvm/lib/Transforms/IPO/SCCP.cpp
@@ -76,10 +76,8 @@ static void findReturnsToZap(Function &F,
                if (!isa<CallBase>(U))
                  return true;
                if (U->getType()->isStructTy()) {
-                 return all_of(Solver.getStructLatticeValueFor(U),
-                               [](const ValueLatticeElement &LV) {
-                                 return !SCCPSolver::isOverdefined(LV);
-                               });
+                 return none_of(Solver.getStructLatticeValueFor(U),
+                                SCCPSolver::isOverdefined);
                }
 
                // We don't consider assume-like intrinsics to be actual address



More information about the llvm-commits mailing list