[PATCH] D72941: Handle ptrtoint in InferAddressSpace

Michael Liao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 07:48:59 PST 2020


hliao added a comment.

In D72941#1828060 <https://reviews.llvm.org/D72941#1828060>, @arsenm wrote:

> In D72941#1828007 <https://reviews.llvm.org/D72941#1828007>, @hliao wrote:
>
> > `inttoptr` and `ptrtoint` should be treated as opaque ones. If needed, they should be handled with target-specific. This pass is definitely not the place to handle them.
> >
> > In D72941#1827075 <https://reviews.llvm.org/D72941#1827075>, @gangche1 wrote:
> >
> > > We see in our IR that has addrspacecast before ptrtoint, which requires this optimization. Therefore suggest to add the handling of ptrtoint.
> >
>
>
> This is backwards, inttoptr/ptrtoint are "copies" that may truncate or trivially extend.  addrspacecast is the opaque part


Thanks for correcting me. What I really mean is that that "copies" are opaque and you cannot interpret them the same as `addrspacecast`. They are different in semantics.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72941/new/

https://reviews.llvm.org/D72941





More information about the llvm-commits mailing list