[llvm-commits] patch: mdnode .bc format change

Nick Lewycky nicholas at mxc.ca
Wed Jul 22 21:50:10 PDT 2009


Devang Patel wrote:
> On Tue, Jul 21, 2009 at 9:51 AM, Devang Patel<devang.patel at gmail.com> wrote:
>> On Mon, Jul 20, 2009 at 10:33 PM, Nick Lewycky<nicholas at mxc.ca> wrote:
>>
>>>> I am moving in a direction where metadata is not derived from
>>>> Constant. I will introduce new block in bitcode to hold metadata
>>>> strings and nodes.
>>> Okay. I assume this goes with removing the uniqueness property from MDNode?
>> No.
> 
> I may have misinterpreted your question. So may be, yes :)
> 
> MDNode will continue to use FoldingSetNode to avoid creating duplicate
> nodes. However when an MDNode element is RAUW'ed then it is possible
> that resulting MDNode may match another existing MDNode.

Okay, let me just check my understanding here.

Let there be two values A and B. Let there be MDNodes !1 = { A, B }, !2 
= { B, B }, !3 = { A, 3 } and !4 = { B, 4 }.

After I call A->rauw(B), we end up collapsing !1 and !2 into the same 
MDNode object, destroying one of them. But, !3 and !4 will remain 
independent of each other, even though they're structurally equivalent.

Is that about right? Or did I misunderstand you entirely? :)

Nick




More information about the llvm-commits mailing list