[llvm-commits] metadata.h/cpp review stuff
Devang Patel
dpatel at apple.com
Tue Oct 20 15:10:17 PDT 2009
On Oct 20, 2009, at 2:48 PM, Chris Lattner wrote:
> On Oct 20, 2009, at 7:08 AM, Devang Patel wrote:
>>> This would shrink them significantly and reduce the games you have
>>> to
>>> play with hiding getNumOperands, overloading operator new, etc.
>>> Also,
>>> MetadataBase doesn't have much common state, it isn't clear it needs
>>> to exist at all.
>>>
>>> There is some seriously confused code circling around
>>> MetadataBase::resizeOperands. It looks like half the code thinks
>>> that
>>> operands can happen, but half doesn't. Please remove all this
>>> stuff.
>>
>> It is trying to maintain following use counts
>>
>> !1 = { i32 1} ; [uses 1]
>> !2 = { !1 } ; [uses 0]
>>
>> ...
>> call @llvm.dbg.blah(!1, !2)
>> ...
>>
>> Metadata used by another metadata is counted as regular uses.
>> Metadata
>> used by non-metadata values is not a normal use (it is invisible to
>> the non-metadata value). This is why the hierarchy is based on User
>> and operand list is only counting metadata uses.
>
> Ok, I see now that you're doing this. But why? :) What capability
> does this provide? Is there another way to get it? This capability
> costs a lot of complexity, memory and compile time.
This may be useful to reduce memory pressure by allowing metadata user
to delete MDNode and its MDNode users. After stumbling couple of times
to get this, I am also wondering whether this is worth it or not or is
this the right approach.
MDNodes are uniqued, just like Constant. However Constants become
zoombie if its use count is reduced to zero. This may be too expensive
for metadata because of possibility of high volume of metadata in the
IR due to various reasons.
-
Devang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20091020/50249b08/attachment.html>
More information about the llvm-commits
mailing list