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

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 21 07:36:52 PDT 2024


================
@@ -641,7 +641,7 @@ LazyValueInfoImpl::solveBlockValueImpl(Value *Val, BasicBlock *BB) {
   // instruction is placed, even if it could legally be hoisted much higher.
   // That is unfortunate.
   PointerType *PT = dyn_cast<PointerType>(BBI->getType());
-  if (PT && isKnownNonZero(BBI, DL))
+  if (PT && isKnownNonZero(BBI, /*Depth=*/0, SimplifyQuery(DL)))
----------------
nikic wrote:

FWIW, you could just pass `DL` here and other places that use only DL. It will be converted implicitly. But this is fine.

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


More information about the llvm-commits mailing list