[llvm] r258149 - Use larger write sizes for MCFillFragment.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 10:21:16 PST 2016
> On Jan 19, 2016, at 10:04 AM, Rafael Espíndola via llvm-commits <llvm-commits at lists.llvm.org> wrote:
>
> I just realized I could write the test as attached, but it is probably
> still not worth it.
Yeah, thats an interesting stress test for sure, but you’d probably break some particularly constrained devices like raspberry PIs or something like that.
Pete
>
> Cheers,
> Rafael
>
> On 19 January 2016 at 12:47, Rafael Espindola via llvm-commits
> <llvm-commits at lists.llvm.org> wrote:
>> Author: rafael
>> Date: Tue Jan 19 11:47:48 2016
>> New Revision: 258149
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=258149&view=rev
>> Log:
>> Use larger write sizes for MCFillFragment.
>>
>> This brings the pr26208 testcase down to 3.2 seconds. Not checking it in
>> since it does create a 4GB .o file.
>>
>> Modified:
>> llvm/trunk/lib/MC/MCAssembler.cpp
>>
>> Modified: llvm/trunk/lib/MC/MCAssembler.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAssembler.cpp?rev=258149&r1=258148&r2=258149&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/MC/MCAssembler.cpp (original)
>> +++ llvm/trunk/lib/MC/MCAssembler.cpp Tue Jan 19 11:47:48 2016
>> @@ -488,9 +488,20 @@ static void writeFragment(const MCAssemb
>> case MCFragment::FT_Fill: {
>> ++stats::EmittedFillFragments;
>> const MCFillFragment &FF = cast<MCFillFragment>(F);
>> + uint8_t V = FF.getValue();
>> + const unsigned MaxChunkSize = 16;
>> + char Data[MaxChunkSize];
>> + memcpy(Data, &V, 1);
>> + for (unsigned I = 1; I < MaxChunkSize; ++I)
>> + Data[I] = Data[0];
>>
>> - for (uint64_t I = 0, E = FF.getSize(); I != E; ++I)
>> - OW->write8(FF.getValue());
>> + uint64_t Size = FF.getSize();
>> + for (unsigned ChunkSize = MaxChunkSize; ChunkSize; ChunkSize /= 2) {
>> + StringRef Ref(Data, ChunkSize);
>> + for (uint64_t I = 0, E = Size / ChunkSize; I != E; ++I)
>> + OW->writeBytes(Ref);
>> + Size = Size % ChunkSize;
>> + }
>> break;
>> }
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
> <pr26208.s>_______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list