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

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 14 19:21:45 PDT 2020


jdoerfert added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4548
+  // Call stripPointerCastsSameRepresentation to take addrspacecast out of
+  // consideration.
+  auto *StrippedV = V->stripPointerCastsSameRepresentation();
----------------
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.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4553
+    // gep inbounds null, 0 is also null.
     return true;
 
----------------
misplaced comment


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