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
|
#else
|
||||||
if (OutBufCur+Size >= OutBufEnd)
|
if (OutBufCur+Size >= OutBufEnd)
|
||||||
FlushBuffer();
|
FlushBuffer();
|
||||||
|
|
||||||
|
switch (Size) {
|
||||||
|
default:
|
||||||
memcpy(OutBufCur, Ptr, Size);
|
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;
|
OutBufCur += Size;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue