[llvm-dev] Redundant ptrtoint/inttoptr instructions

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 2 11:02:48 PDT 2020


On 7/2/20 12:16 PM, Matt Arsenault wrote:
>
>
>> On Jul 2, 2020, at 13:09, Hal Finkel via llvm-dev 
>> <llvm-dev at lists.llvm.org <mailto: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


Makes sense to me.

  -Hal


-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory

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


More information about the llvm-dev mailing list