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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

We don't need a lambda here.


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


1 Files Affected:

- (modified) llvm/lib/Transforms/IPO/SCCP.cpp (+2-4) 


``````````diff
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

``````````

</details>


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


More information about the llvm-commits mailing list