[llvm] [Attributor] Don't follow pointer-to-integer casts in AAPointerInfo (PR #225290)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 26 07:24:43 PDT 2026


https://github.com/nikic commented:

I think it would be preferable if this didn't do "follow all casts apart from ptrtoint and ptrtoaddr" and instead explicitly supported the casts that *are* supported.

The only casts this can reasonably follow are bitcast and addrspacecast.

For bitcast something to keep in mind is that a pointer can be casted to a byte type nowadays -- does this code handle that correctly? If not, it probably just shouldn't follow though bitcasts either, because pointer-to-pointer bitcasts do not naturally occur post opaque pointers.

So in that case it should just follow addrspacecasts and nothing else.

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


More information about the llvm-commits mailing list