[PATCH] D20582: Don't add repeats of llvm.ident list when linking

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 17:47:08 PDT 2016


> On 2016-Sep-12, at 17:06, Matt Arsenault <arsenm2 at gmail.com> wrote:
> 
> 
>> On Sep 12, 2016, at 14:58, Duncan P. N. Exon Smith via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>> 
>> Sorry for the long delay on this one Matt.
>> 
>> Do you have any thoughts on Jan's question above?
>>> Is there a reason not to dedup all metadata nodes?
> 
> I’m not sure. This is also a problem for the opencl version metadata.
> 
>> 
>> It does seem strange to me to apply this to !llvm.ident, but nothing else.  I don't know if we want to special case it.  I'm also slightly concerned that this is quadratic in the number of unique nodes referenced; not we'll suddenly have a large number of separate compilers, but we couldn't efficiently extend this to other cases.
>> 
>> I wonder what it would take to give NamedMDNode the semantics of a SetVector?  This would require an llvm-dev discussion, but I don't know of any current metadata uses where it would be problematic, and then addOperand will just "do the right thing”.
> 
> The module flags metadata has separate append and append unique options, so that seems to imply to me that some metadata uses are intended to be duplicates. I’m not sure why these flags only apply in the special case of module flags though

I strongly suspect the non-duplicate one came first, and then someone wanted to avoid duplicates for their use case but didn't want to worry about the general case.


More information about the llvm-commits mailing list