[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 25 14:11:55 PDT 2020
arsenm added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:238-239
+ return false;
+ // Check it's really safe to treat that pair of `ptrtoint`/`inttoptr` is a
+ // no-op cast. Besides checking both of them are no-op casts, as the
+ // reinterpreted pointer may be used in other pointer arithemetic, we also
----------------
The grammar for the first sentence is off. "Check if the pair of ptrtoint/inttoptr is a no-op cast."
================
Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:246
+ // especially a clear definition for pointer bits in non-0 address spaces. It
+ // would be an undefined behavior if that pointer bits are accessed after an
+ // invalid reinterpret cast. Also, due to the unclearness for the meaning of
----------------
No "an".
"if that pionter is dereferenced" would be more specific than than "pointer bits accessed"
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81938/new/
https://reviews.llvm.org/D81938
More information about the llvm-commits
mailing list