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

Devang Patel dpatel at apple.com
Tue Feb 26 10:35:25 PST 2008


On Feb 26, 2008, at 10:20 AM, Chris Lattner wrote:

> 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.

yup, I'm going to add new ReturnInst constructors in separate patch.

> While we don't care much about the performance of the .ll parser, we
> do care about the perf of the bc reader.
>
> -Chris
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-
Devang






More information about the llvm-commits mailing list