<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Nov 12, 2013, at 4:19 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com">chandlerc@google.com</a>> wrote:<div><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Nov 12, 2013 at 4:14 PM, Chris Lattner <span dir="ltr"><<a href="mailto:clattner@apple.com" target="_blank" class="cremed">clattner@apple.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I'm moderately opposed to just encoding these in a string format. I think we can do something substantially better both for space, time, and readability. Fundamentally, there is no reason for the original metadata node you describe to not *encode* its operands into a dense bit-packed blob of memory. We can still expose APIs that manipulate them as separate entities, and have the AsmPrinter and AsmParser map back and forth with nice human-readable forms. But even a simple varint encoding will be both smaller and faster than ascii.</div>
</div></div></div></blockquote><div><br></div></div><div>I guess you could make it work, but would that actually be simpler than what is proposed? If it is denser, how much denser would it have to be to justify the complexity?</div>
</blockquote><div><br></div><div>I don't think it would be more complex than a string encoding. At least, I'm not imagining we want to be super clever here.</div><div><br></div><div>I could even imagine doing a versioned giant bitfield and using the version to handle auto-upgrade…</div>
</div></div></div></blockquote><div><br></div><div>You must mean something other than I’m imagining :-). From your description, I think you’re describing that we have some new kind of “compressed mdnode” that bitpacks data in some way, and that we’d have the existing .ll and .bc syntax be magically compacted without a syntax change. Is that what you’re describing?</div><div><br></div><div>If so, that sounds really complicated: all of the readers would have to recognize the new format, and we lose alignment of in memory IR with the printed form (making debugging the compiler simpler).</div><div><br></div><div>If you’re talking about exposing this as syntax in .ll files (and encoding details in .bc files) then I’m not sure how this would work. You’d have to have the schema for each node described somewhere. Where would this exist.</div><div><br></div><div>More generally, can you explain more of what you’re thinking here?</div><br><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto;"><div><div class="im"><blockquote type="cite"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div>Just to be clear, I still want the nice format (much like your proposed format, but maybe with the numbers outside of the "s) in the textual IR, I just think we should use a more direct and efficient in-memory encoding (and in-bitcode encoding if that isn't already suitably dense).</div>
</div></div></div>
</blockquote></div></div><br><div>Where would the encoding schema be specified?</div></blockquote><div><br></div><div>Same question applies to a string encoding. We have to define the schema somewhere clearly. I'm just lobbying for the textual IR and the APIs to both operate directly on N fields, and just make the memory representation dense.</div></div></div></div></blockquote><br></div><div>The advantage of strings is that it moves the schema complexity to the debug info - related machinery like DIBuilder. The core IR features like MDNode, the asmparser/writer, bitcode support, etc don’t need anything specific to debug information.</div><div><br></div><div>-Chris</div></body></html>