[llvm-commits] [llvm] r47583 - in /llvm/trunk: lib/Bitcode/Reader/BitcodeReader.cpp lib/Bitcode/Writer/BitcodeWriter.cpp test/Assembler/2008-02-20-MultipleReturnValue.ll

Chris Lattner clattner at apple.com
Tue Feb 26 10:20:35 PST 2008


On Feb 25, 2008, at 5:29 PM, Devang Patel wrote:
>
> URL: http://llvm.org/viewvc/llvm-project?rev=47583&view=rev
> Log:
> Update bitcode reader and writer to handle multiple return values.
> Take 2.

Thanks Devang,

> +++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Mon Feb 25  
> 19:29:32 2008
> @@ -1337,17 +1337,24 @@
>     }
>
>     case bitc::FUNC_CODE_INST_RET: // RET: [opty,opval<optional>]
> +      {
> +        unsigned Size = Record.size();
> +        if (Size == 0) {
> +          I = new ReturnInst();
> +          break;
> +        } else {
> +          unsigned OpNum = 0;
> +          std::vector<Value *> Vs;

Using a std::vector for all cases will cause malloc traffic even in  
the size=1 case.  It would be better to use an SmallVector<Value*, 4>  
here.  However, that requires changing ReturnInst ctor to take pointer 
+count as input.

While we don't care much about the performance of the .ll parser, we  
do care about the perf of the bc reader.

-Chris



More information about the llvm-commits mailing list