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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 08:13:49 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:
> aqjune wrote:
> > 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
> Yes, looks like that one needs to be fixed as well.
Made a patch here: D88360.


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

https://reviews.llvm.org/D88276



More information about the llvm-commits mailing list