[PATCH] D54956: [ValueTracking] Look through casts when determining non-nullness

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 27 15:16:32 PST 2018


jdoerfert marked an inline comment as done.
jdoerfert added inline comments.


================
Comment at: lib/Analysis/LazyValueInfo.cpp:1714
   if (V->getType()->isPointerTy() && C->isNullValue() &&
-      isKnownNonZero(V->stripPointerCasts(), DL)) {
+      isKnownNonZero(V, DL)) {
     if (Pred == ICmpInst::ICMP_EQ)
----------------
I'm not sure this is the right fix but I know we have to do something to pass "callsite_nonnull_args_through_casts.ll" with -O3 (even without my modifications below!).
The alternative, making sure Value::stripPointerCasts() is not stripping of AddrSpaceCasts, makes more and more sense to me as I always assumed it not to change "the value".


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54956





More information about the llvm-commits mailing list