gangche1 added a comment. What if I add another query in TTI, check if an address space has the same bit-pattern as the flat-address, then handle the ptrtoint with this extra condition? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72941/new/ https://reviews.llvm.org/D72941