[PATCH] D106289: [InstCombine] Fold phi ( inttoptr/ptrtoint x ) to phi (x)

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 04:52:35 PDT 2021


aqjune added a comment.

In D106289#2916096 <https://reviews.llvm.org/D106289#2916096>, @lebedev.ri wrote:

> In D106289#2916089 <https://reviews.llvm.org/D106289#2916089>, @aqjune wrote:
>
>> I have a question about addrspacecast: is ptrtoint(inttoptr(ptrtoint pty1 p) to pty2) equivalent to ptrtoint(addrspacecast pty1 p to pty2)?
>> Does anyone have idea about this?
>
> I'm going to guess no. `inttoptr`/`ptrtoint` are essentially no-op bitcasts,
> while `addrspacecast` is implementation-defined and in general case can be assumed to e.g. offset the pointer.

Oh, thanks. @Krishnakariya does this patch deal with the case?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106289



More information about the llvm-commits mailing list