mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-13 14:35:54 +00:00
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. llvm-svn: 258149
This commit is contained in:
parent
40581de42f
commit
a9f441b419
@ -488,9 +488,20 @@ static void writeFragment(const MCAssembler &Asm, const MCAsmLayout &Layout,
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user