[llvm-commits] patch: support instructions in MDNode

Nick Lewycky nicholas at mxc.ca
Sat Jun 13 11:57:20 PDT 2009


Ping!

I found a bug in the previous patch where it broke parsing of "metadata 
undef" so I fixed that and added a test for that to the test.

Please review?

Nick

Nick Lewycky wrote:
> The attached patch adds support for Instructions in MDNodes to the .ll 
> parser (the printer already supported it) and the .bc reader/writer.
> 
> This also breaks the .bc format for existing .bc files that use MDNode. 
> If you don't know whether you're using MDNode, you aren't. :)
> 
> The design I chose creates a new METADATA_BLOCK which contains entries 
> that list off the node elements. The constants block encodes nothing 
> about an MDNode when it encounters one except for the fact that it exists.
> 
> The alternative I know would work is to store the valueids of the MDNode 
> elements in the constant block. This means that the reader would need to 
> create a ConstantPlaceHolder that stores the list of valueids to use in 
> the ResolveMetadata step. That sounds like a lot of memory usage in the 
> reader to save a few bytes ("enter block") at 1 per module plus 1 per 
> function (assuming the module/functions use metadata; when they don't 
> it's free).
> 
> Please review! I'm particularly interested in way of shaving bytes off 
> the .bc format and speeding up the .bc reading and writing.
> 
> Nick
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mdnode-instructions2.patch
Type: text/x-patch
Size: 21154 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090613/6c5812b8/attachment.bin>


More information about the llvm-commits mailing list