[LLVMdev] [RFC] Separating Metadata from the Value hierarchy

Duncan P. N. Exon Smith dexonsmith at apple.com
Mon Nov 10 16:08:31 PST 2014


> On 2014-Nov-10, at 14:13, Philip Reames <listmail at philipreames.com> wrote:
> 
>> 2. No more function-local metadata.
>> 
>>     AFAICT, function-local metadata is *only* used for indirect
>>     references to instructions and arguments in `@llvm.dbg.value` and
>>     `@llvm.dbg.declare` intrinsics.  The first argument of the following
>>     is an example:
>> 
>>         call void @llvm.dbg.value(metadata !{i32 %val}, metadata !0,
>>                                   metadata !1)
>> 
> I hesitate a bit here.  The current range metadata deals only with constant ranges, but I could see a day where encoding a range in terms of two other Values might be useful.  This is one obvious use case, but there may also be others.
> 
> I'm not going to oppose the proposal made, but if there was a way to preserve the ability to reference to function local SSA values, I'd slightly prefer that.

In theory it's possible, but it adds a large complexity burden
because of the need to track whether metadata is local or global.
I strongly prefer dropping it until a compelling use-case appears.

Note that debug info is rather special in that it's *not allowed*
to modify optimizations or code generation.  For non-debug info,
you can reference local values directly using intrinsics, as (e.g.)
@llvm.assume [1] does.

[1]: http://llvm.org/docs/LangRef.html#llvm-assume-intrinsic





More information about the llvm-dev mailing list