[LLVMdev] [RFC] Attributes on Values

Philip Reames listmail at philipreames.com
Tue Sep 9 21:10:52 PDT 2014


On 09/09/2014 08:35 PM, Reid Kleckner wrote:
> On Tue, Sep 9, 2014 at 8:22 PM, Philip Reames 
> <listmail at philipreames.com <mailto:listmail at philipreames.com>> wrote:
>
>     To address the size question asked in a followup, I'll respond
>     somewhat glibly.  We already have metadata on a Value, how is
>     having Attributes in their place any different?  (This is assuming
>     we completely merge metadata and attributes.  No one has seriously
>     proposed doing that yet.  Alternatively, we could merge the
>     storage and preserve the interface separation if we thought that
>     was useful.)
>
>
> Attributes and metadata aren't completely interchangeable. Metadata is 
> semantically unimportant and can always be dropped (TBAA, debug info, 
> stuff). Attributes can control semantically important things like how 
> to pass a parameter, and can't necessarily be dropped.
I agree that the semantic separation between "stuff that can be dropped" 
and "stuff that can't" needs to be preserved.  I would argue that this 
distinction is not tied to the *implementation* of metadata and 
attributes today.  As someone else pointed out in this thread, there are 
some attributes (nonnull for instance) which can be safely dropped 
without effecting correctness.

Utter side note: Has anyone written a utility pass to drop "safe to 
drop" metadata and attributes?  Running the test suite with and without 
such a pass in the pass ordering might be a good way to identify places 
where such attributes have accidentally picked up functionality relevant 
semantics.  :)

Philip

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


More information about the llvm-dev mailing list