[llvm-commits] [llvm] r165739 - in /llvm/trunk: include/llvm/Bitcode/BitstreamReader.h lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Reader/BitcodeReader.h lib/Bitcode/Writer/BitcodeWriter.cpp test/Bitcode/function-encoding-rel-operands.ll

Duncan Sands baldrick at free.fr
Thu Oct 11 13:32:09 PDT 2012


Hi Jan,

> Change encoding of instruction operands in bitcode binaries to be relative
> to the instruction position.  The old encoding would give an absolute
> ID which counts up within a function, and only resets at the next function.

it looks great!  I did notice the following typos:

> --- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h (original)
> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.h Thu Oct 11 15:20:40 2012
> @@ -179,18 +179,27 @@
>     typedef std::pair<unsigned, GlobalVariable*> BlockAddrRefTy;
>     DenseMap<Function*, std::vector<BlockAddrRefTy> > BlockAddrFwdRefs;
>
> +  /// UseRelativeIDs - Indicates that we are using a new encoding for
> +  /// instrunction operands where most operands in the current

instrunction -> instruction

> +  /// FUNCTION_BLOCK are encoded relative to the instruction number,
> +  /// for a more compact encoding.  Some instruction operands are not
> +  /// relative to the instruction ID: basic block numbers, and types.
> +  /// Once the old style function blocks have been phased out, we would
> +  /// not need this flag.
> +  bool UseRelativeIDs;
...

> @@ -1514,8 +1551,8 @@
>   // Emit blockinfo, which defines the standard abbreviations etc.
>   static void WriteBlockInfo(const ValueEnumerator &VE, BitstreamWriter &Stream) {
>     // We only want to emit block info records for blocks that have multiple
> -  // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK.  Other
> -  // blocks can defined their abbrevs inline.
> +  // instances: CONSTANTS_BLOCK, FUNCTION_BLOCK and VALUE_SYMTAB_BLOCK.
> +  // Other blocks can defined their abbrevs inline.

can defined -> can define

>     Stream.EnterBlockInfoBlock(2);
>
>     { // 8-bit fixed-width VST_ENTRY/VST_BBENTRY strings.

Ciao, Duncan.




More information about the llvm-commits mailing list