In OutputString, avoid calling memcpy for really tiny strings.
This speeds up -E on 447.dealII by 5.8% llvm-svn: 40423
This commit is contained in:
parent
0af9823e4d
commit
93c4ea75ec
|
@ -87,7 +87,20 @@ static void OutputString(const char *Ptr, unsigned Size) {
|
|||
#else
|
||||
if (OutBufCur+Size >= OutBufEnd)
|
||||
FlushBuffer();
|
||||
|
||||
switch (Size) {
|
||||
default:
|
||||
memcpy(OutBufCur, Ptr, Size);
|
||||
break;
|
||||
case 3:
|
||||
OutBufCur[2] = Ptr[2];
|
||||
case 2:
|
||||
OutBufCur[1] = Ptr[1];
|
||||
case 1:
|
||||
OutBufCur[0] = Ptr[0];
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
OutBufCur += Size;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue