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

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 15 01:02:42 PDT 2020


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


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4548
+  // Call stripPointerCastsSameRepresentation to take addrspacecast out of
+  // consideration.
+  auto *StrippedV = V->stripPointerCastsSameRepresentation();
----------------
jdoerfert wrote:
> aqjune wrote:
> > jdoerfert wrote:
> > > This is not 100% the idea behind `stripPointerCastsSameRepresentation`:
> > > `stripPointerCastsSameRepresentation` says the bit-representation stays the same, not that there are no addrspacecasts stripped. If we assume an addressspacecast that is known not to modify the bit-representation will also not modify the poison/undef state, which I think is reasonable, we can do tihs.
> > Yes, I think in that case undef/poison should be preserved. LangRef says that addrspacecast can be no-op, I believe this function is dealing with the case. 
> > Updated comment
> As I said, the function will strip (any) casts that are known not to change the bit representation. I agree that this should be fine here but the comment makes it sounds as if only some addrspacecasts are stripped.
Made the comment clearer & clarify why gep inbounds was mentioned here


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