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

Devang Patel devang.patel at gmail.com
Mon Jul 20 17:13:58 PDT 2009


Nick,

On Fri, Jul 3, 2009 at 9:19 PM, Nick Lewycky<nicholas at mxc.ca> wrote:
> This patch implements the new MDNode on-disk format for .bc files which we
> would use if we supported instructions in MDNodes.
>
> This format is plainly inefficient when MDNodes only contain constants, but
> I don't want to release 2.6 with a legacy file format that we need to
> support.
>
> In the current format we store the MDNodes in the Constants block with
> references to the other constants by number.
>
> The new format mentions the MDNodes in the Constant block but stores no data
> about them other than the fact they exist.

Why not put MDNodes in METADATA_BLOCK ?

Other comments:

- I think WriteMetadata() is going to write MDNode multiple times.
- Reusing ConstantPlaceHolder for Metadata is not a good idea, I've
doubts that this will work. ConstantPlaceHolder is meant for
ConstExprs.

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.
-
Devang



More information about the llvm-commits mailing list