[PATCH] D76010: [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into more constants/instructions

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 08:37:22 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4571
+      return true;
+  }
 
----------------
aqjune wrote:
> jdoerfert wrote:
> > jdoerfert wrote:
> > > Nit: No braces.
> > > Use OpCheck for BitCastInst as well.
> > What does " To guarantee that the result isn't poison, the stripped pointer should be checked whether it is inbounds." mean? You cannot/should bot check the stripped value, e.g. determine how we got here.
> > What does " To guarantee that the result isn't poison, the stripped pointer should be checked whether it is inbounds." mean?
> 
> It means the stripped pointer should be an in-bounds address of an allocated object, not that it should be `gep inbounds` again ( `.. if the base pointer is not an in bounds address of an allocated object`, LangRef's getelementptr instruction).
I think what you try to say is something along the lines of:

"To guarantee that the result isn't poison, the stripped pointer is checked as it has to be pointing into an allocated object or be null `null` to ensure `inbounds` getelement pointers with a zero offset could not produce poison."


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D76010





More information about the llvm-commits mailing list