[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 17 13:29:51 PDT 2020


arsenm added a comment.

In D81938#2096732 <https://reviews.llvm.org/D81938#2096732>, @hliao wrote:

> In D81938#2096500 <https://reviews.llvm.org/D81938#2096500>, @arsenm wrote:
>
> > I'm not entirely convinced this is safe in all contexts. I think you can argue that this is safe if it directly feeds a memory instruction, as the access would be undefined if it weren't valid to do the no-op cast. However, I'm not sure if this is safe if used purely in arithmetic contexts. If you're just comparing the reinterpreted pointer values for example, I don't think that would be undefined
>
>
> Would it be safe if we double-check the target hook and ensure that's a no-op `addrspacecast` between address spaces?


Yes, that would be safer since you can see there's no difference


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