[PATCH] D69571: [ValueTracking] Allow context-sensitive nullness check for non-pointers

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 01:26:23 PDT 2019


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:556
+        Pred, Incoming, RHS,
+        {Q.DL, Q.TLI, Q.DT, Q.AC, InTI, Q.IIQ.UseInstrInfo}, MaxRecurse);
     // If the operation failed to simplify, or simplified to a different value
----------------
You can use `Q.getWithInstruction(InTI)` here.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:1906
+  if (isa<Constant>(V))
+    return false;
 
----------------
Why can't this be an assert? Looks like the Constant case is fully handled first in `isKnownNonZero()`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69571





More information about the llvm-commits mailing list