[llvm-dev] [LLVMdev] Moving towards a singular pointer type

James Courtier-Dutton via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 17 07:18:22 PDT 2017


On 16 April 2017 at 22:24, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Sun, Apr 16, 2017 at 2:34 AM James Courtier-Dutton via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Hi,
>>
>> Did this work ever get done? There was a long thread about it back in
>> 2015.
>>
>> I wish to use IRBuilder.
>> Is there any documentation?
>> How do I use the singular pointer type in GEP, LOAD, STORE instructions?
>>
>
> Sorry, no, the work is not complete - for now you'll need to pass the
> pointer and pointee type to a few of these functions and some will do it
> for you (Getting the pointee type from the pointer type, etc). I'll
> hopefully be coming back around to this in 6-9 months to continue on it
> (finishing off one or two IR constructs, then making sure all the
> optimizations can cope with this)
>
> - Dave
>

Hi Dave,

I think if the optimizations changed from the concept of the pointer having
a type, to instead the memory location itself having the type. Then we
might make some good progress in improving the optimizations.
If one has the concept of the memory location itself having a type, it is
then obvious that any GEP operation is likely to result in a pointer to a
different memory location, and therefore have a different type. So, giving
a pointer a type is not particularly useful.
If the pointer having a type is useful in some way to optimizations, then
the GEP instruction should really be a combined GEP and BITCAST instruction.

The singular pointer type (i.e. type-less) goes some way towards achieving
this.

Kind Regards


James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170417/0718a756/attachment.html>


More information about the llvm-dev mailing list