[LLVMdev] Proposal: extended MDString syntax

Chandler Carruth chandlerc at google.com
Thu Jun 27 10:12:16 PDT 2013


On Thu, Jun 27, 2013 at 9:50 AM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

> On Jun 26, 2013, at 4:18 PM, Eric Christopher <echristo at gmail.com> wrote:
>
> > So inverting it so that MI contains LLVM IR instead of the other way
> > around? Then we'd need a serialization format for MI that happened to
> > include a way of serializing LLVM IR within. From a quick "hey, this
> > seems reasonable" the idea of embedding the MI into the IR rather than
> > the other way around seems to make sense since we have already have
> > code to serialize the IR.
>
> I’d suggest something based on YAML which would allow you to include IR
> verbatim just by indenting it.
>

We can also use YAML embedded inside IR, potentially using the string
syntax Dan proposed or any other number of embedding mechanisms.

I like using YAML to represent the somewhat arbitrary datastructures of MI
so that we don't spend a lot of time inventing clever syntax for something
that has much more limited uses than the actual IR. I haven't heard anyone
really object to it.

However, I do think it's an open question as to whether to embed IR in a MI
container, or MI in an IR container. A few observations:

- No one has pointed out any really fundamental *problems* with any of the
approaches. I think both approaches can be made to work with reasonable
amounts of effort, and neither has really fundamental design problems.

- Different use cases will be more or less easy to write in different
forms. For example, Jakob's point:

> The IR module should be optional when serializing MI. The back-pointers
> from MI to IR are not required, and I can imagine many useful test cases
> that won’t need them.


I've heard Dan and others say exactly the opposite -- that MI should be
optional. I suspect that some test cases are more MI focused, and some are
less. But I don't see either being optional as a hard prerequisite.


So, here is my concrete suggestion: if all of these approaches seem to work
and there aren't huge downsides but only reasonable tradeoffs, let the
folks writing the patches make the decision. At the moment that appears to
be Dan and maybe Bob. Is there a reason to not let them pick the design
they want to make forward progress with and run with it? I think that will
be much more productive and get us back to the important part: testing
MI-level passes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130627/75768afd/attachment.html>


More information about the llvm-dev mailing list