From: Chris Lattner Date: Sun, 13 May 2007 00:59:52 +0000 (+0000) Subject: finish the description of the bitstream format. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=7300af5896d879bfc476dfbcb4ec23e352797c4f;p=oota-llvm.git finish the description of the bitstream format. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37016 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/BitCodeFormat.html b/docs/BitCodeFormat.html index 0c4cd63f844..70f0ec27492 100644 --- a/docs/BitCodeFormat.html +++ b/docs/BitCodeFormat.html @@ -19,6 +19,7 @@
  • Blocks
  • Data Records
  • Abbreviations
  • +
  • Standard Blocks
  • LLVM IR Encoding
  • @@ -403,16 +404,100 @@ Literal operands specify that the value in the result is always a single specific value. This specific value is emitted as a vbr8 after the bit indicating that it is a literal operand.
  • Encoding info without data - [01, encoding3] - - blah + - Operand encodings that do not have extra data are just emitted as their code.
  • Encoding info with data - [01, encoding3, -valuevbr5] - - +valuevbr5] - Operand encodings that do have extra data are +emitted as their code, followed by the extra data.
  • +

    The possible operand encodings are:

    + + + +

    For example, target triples in LLVM modules are encoded as a record of the +form [TRIPLE, 'a', 'b', 'c', 'd']. Consider if the bitstream emitted +the following abbrev entry:

    + + + +

    When emitting a record with this abbreviation, the above entry would be +emitted as:

    + +

    [4abbrevwidth, 24, 4vbr6, + 06, 16, 26, 36]

    + +

    These values are:

    + +
      +
    1. The first value, 4, is the abbreviation ID for this abbreviation.
    2. +
    3. The second value, 2, is the code for TRIPLE in LLVM IR files.
    4. +
    5. The third value, 4, is the length of the array.
    6. +
    7. The rest of the values are the char6 encoded values for "abcd".
    8. +
    + +

    With this abbreviation, the triple is emitted with only 37 bits (assuming a +abbrev id width of 3). Without the abbreviation, significantly more space would +be required to emit the target triple. Also, since the TRIPLE value is not +emitted as a literal in the abbreviation, the abbreviation can also be used for +any other string value. +

    + + + + +
    Standard Blocks +
    + +
    + +

    +In addition to the basic block structure and record encodings, the bitstream +also defines specific builtin block types. These block types specify how the +stream is to be decoded or other metadata. In the future, new standard blocks +may be added. +

    +
    + +
    #0 - BLOCKINFO +Block
    + +
    + +

    The BLOCKINFO block allows the description of metadata for other blocks. The + currently specified records are:

    + + + +

    +The SETBID record indicates which block ID is being described. The standard +DEFINE_ABBREV record specifies an abbreviation. The abbreviation is associated +with the record ID, and any records with matching ID automatically get the +abbreviation. +

    + +
    LLVM IR Encoding