[llvm] [IR] Introduce the `ptrtoaddr` instruction (PR #139357)

Owen Anderson via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 19 06:49:46 PDT 2025


resistor wrote:

> The set address operation can already be encoded by `ptradd(p, new_addr - ptrtoaddr(p))`. I doubt we're going to add an instruction for that. We might add an intrinsic. But I don't think think this needs to be coupled to the ptrtoaddr introduction.

I would be concerned that if we canonicalized to this composite pattern, pattern matching it for instruction selection would very easily get broken by unrelated InstCombines/DAGCombines.

https://github.com/llvm/llvm-project/pull/139357


More information about the llvm-commits mailing list