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

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 04:42:10 PDT 2021


lebedev.ri added a comment.

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.


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