[llvm] [InstCombine] Simplify nonnull phi nodes (PR #128466)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 24 03:50:15 PST 2025


================
@@ -996,7 +996,7 @@ Value *InstCombinerImpl::simplifyNonNullOperand(Value *V,
   if (!V->hasOneUse())
     return nullptr;
 
-  if (Depth == 1)
+  if (Depth == 2)
----------------
dtcxzyw wrote:

It would be better to use `RecursionLimit = 3`. To avoid expensive recursion in phi handling, we can pass `Depth = RecursionLimit` instead.


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


More information about the llvm-commits mailing list