[llvm-commits] [llvm] r97132 - in /llvm/trunk/lib/Bitcode: Reader/BitcodeReader.cpp Writer/ValueEnumerator.cpp

Nick Lewycky nlewycky at google.com
Thu Feb 25 11:47:29 PST 2010


On 25 February 2010 09:54, Devang Patel <dpatel at apple.com> wrote:

>
> On Feb 25, 2010, at 12:30 AM, Nick Lewycky wrote:
>
> Author: nicholas
> Date: Thu Feb 25 02:30:17 2010
> New Revision: 97132
>
> URL: http://llvm.org/viewvc/llvm-project?rev=97132&view=rev
> Log:
> Make the side-numbering of instructions used by metadata (which is needed
> to
> keep track of instructions that return void) per-function
>
>
> It is used to connect metadata with respective instruction when metadata is
> attached with an instruction.
>

Yes of course. The not-so-obvious part is why you needed a side-numbering
instead of just using value IDs which is the basis for the rest of the
bitcode format. The problem is that the value enumerator doesn't number void
instructions, such as "ret", where you want to attach metadata.
Just making the VE enumerate void instructions would break backwards
compatibility too, since bitcode relies on the reader and writer to have a
matching numbering scheme where we don't store the concrete numbers.

After thinking about this, I think the right way to go forward is to create
new FUNC_CODE_INST_FOO entries for the void instructions so that the bitcode
reader knows it's expected to number them and the writer's VE can number
everything.

In any event, I'm happy now that the bug is fixed and the format is designed
well enough that we can keep compatibility with future changes. I'm not
planning any more changes here.

Nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100225/87e790da/attachment.html>


More information about the llvm-commits mailing list