[llvm-dev] Redundant ptrtoint/inttoptr instructions

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 2 10:16:58 PDT 2020



> On Jul 2, 2020, at 13:09, Hal Finkel via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> My general feeling is this: No optimizations should be creating int2ptr/ptr2int. We really need to fix them all. They should use pointer casts and i8* GEPs. This has, unfortunately, been a problem for a long time. As Johannes says, optimizing int2ptr/ptr2int is very tricky. In part, becaue all dependencies, including implicit control dependencies, end up being part of the resulting aliasing based-on chain, and we have a set of bug reports discussing this is great detail.
> 
>  -Hal
> 
We recently started introducing some more of these to represent no-op address space conversions in cases where pointer bits are reinterpreted. There’s currently a whole in the IR where there’s no other way to represent a pointer reinterpret. To fix this case, I think we need to re-allow bitcasts between pointers with different address spaces, but the same size.

-Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200702/4455a0e8/attachment.html>


More information about the llvm-dev mailing list