[LLVMdev] byval in a world without pointee types

David Blaikie dblaikie at gmail.com
Mon Mar 9 13:34:37 PDT 2015


On Mon, Mar 9, 2015 at 1:23 PM, Reid Kleckner <rnk at google.com> wrote:

> On Mon, Mar 9, 2015 at 12:58 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
>> On Mon, Mar 9, 2015 at 12:38 PM, Reid Kleckner <rnk at google.com> wrote:
>>
>>> If we're keeping types on GEP,
>>>
>>
>> You mean rather than just dropping gep entirely & doing manual pointer
>> arithmetic? (& moving inbounds to an attribute on pointer addition, I
>> guess?)
>>
>
> Yep. If we're keeping the GEP sugar to say, "hey this pointer arithmetic
> is actually trying to access field #4", then we should keep the allocation
> sugar that says "these 4 bytes are (usually) an i32."
>

*nod*


>
> then IMO we should keep them on allocas and globals. It keeps the IR human
>>> readable.
>>>
>>
>> & what of byval, then? Do you agree with Chandler's argument from analogy
>> between byval, alloca, and globals?
>>
>> (oh, and I should look at inalloca a bit too - it looks like it uses the getByValTypeAlignment
>> too... )
>>
>
> byval and inalloca are edge cases where we can afford to sacrifice some
> readability.
>

I'm pretty comfortable with that perspective - but I'll leave this out here
in case others (including Chandler) want to chime in & clarify/delve/etc.

(I'm working on GEP operators in the mean time anyway, so I'm not
immediately blocked on this)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150309/2c933237/attachment.html>


More information about the llvm-dev mailing list