[PATCH] D76010: [ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into more constants/instructions
Juneyoung Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 14 20:26:24 PDT 2020
aqjune marked 4 inline comments 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:
> 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
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4553
+ // gep inbounds null, 0 is also null.
return true;
----------------
jdoerfert wrote:
> misplaced comment
Added more text to the comment, my underlying idea was that null was also allowed in this case as well.
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