[llvm] [ValueTracking] Convert `isKnownNonZero` to use SimplifyQuery (PR #85863)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 11 08:29:14 PDT 2024


================
@@ -2821,11 +2819,10 @@ static Constant *computePointerICmp(CmpInst::Predicate Pred, Value *LHS,
     // the other operand can not be based on the alloc - if it were, then
     // the cmp itself would be a capture.
     Value *MI = nullptr;
-    if (isAllocLikeFn(LHS, TLI) &&
-        llvm::isKnownNonZero(RHS, DL, 0, nullptr, CxtI, DT))
+    if (isAllocLikeFn(LHS, TLI) && llvm::isKnownNonZero(RHS, /*Depth=*/0, Q))
       MI = LHS;
     else if (isAllocLikeFn(RHS, TLI) &&
-             llvm::isKnownNonZero(LHS, DL, 0, nullptr, CxtI, DT))
+             llvm::isKnownNonZero(LHS, /*Depth=*/0, Q))
----------------
goldsteinn wrote:

Is there a reason we where skipping assumptioncache before?

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


More information about the llvm-commits mailing list