[PATCH] D88276: [IsKnownNonZero] Handle the case with non-constant phi nodes

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 00:40:24 PDT 2020


aqjune added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2567
+    bool AllNonZero = llvm::all_of(PN->operands(), [&](Value *V) {
+      return isKnownNonZero(V, DemandedElts, Depth, Q);
     });
----------------
nikic wrote:
> It is necessary to adjust the context instruction in Q to be the terminator of the incoming edge here (see what computeKnownBits does for example).
Does it mean that we need updates in a few other places as well (orthogonally from this patch)? e.g., https://github.com/llvm/llvm-project/blob/master/llvm/lib/Analysis/ValueTracking.cpp#L2970


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88276/new/

https://reviews.llvm.org/D88276



More information about the llvm-commits mailing list