mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-11 21:57:55 +00:00
ea03e10fac
Microoptimize Twine's with unsigned and int to not pin their value to the stack. This saves stack space in common cases and allows mem2reg in the caller. A simple example is: void foo(const Twine &); void bar(int x) { foo("xyz: " + Twine(x)); } Before: __Z3bari: subq $40, %rsp movl %edi, 36(%rsp) leaq L_.str3(%rip), %rax leaq 36(%rsp), %rcx leaq 8(%rsp), %rdi movq %rax, 8(%rsp) movq %rcx, 16(%rsp) movb $3, 24(%rsp) movb $7, 25(%rsp) callq __Z3fooRKN4llvm5TwineE addq $40, %rsp ret After: __Z3bari: subq $24, %rsp leaq L_.str3(%rip), %rax movq %rax, (%rsp) movslq %edi, %rax movq %rax, 8(%rsp) movb $3, 16(%rsp) movb $7, 17(%rsp) leaq (%rsp), %rdi callq __Z3fooRKN4llvm5TwineE addq $24, %rsp ret It saves 16 bytes of stack and one instruction in this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103107 91177308-0d34-0410-b5e6-96231b3b80d8 |
||
---|---|---|
.. | ||
Allocator.cpp | ||
APFloat.cpp | ||
APInt.cpp | ||
APSInt.cpp | ||
circular_raw_ostream.cpp | ||
CMakeLists.txt | ||
CommandLine.cpp | ||
ConstantRange.cpp | ||
COPYRIGHT.regex | ||
Debug.cpp | ||
DeltaAlgorithm.cpp | ||
Dwarf.cpp | ||
ErrorHandling.cpp | ||
FileUtilities.cpp | ||
FoldingSet.cpp | ||
FormattedStream.cpp | ||
GraphWriter.cpp | ||
IsInf.cpp | ||
IsNAN.cpp | ||
Makefile | ||
ManagedStatic.cpp | ||
MemoryBuffer.cpp | ||
MemoryObject.cpp | ||
PluginLoader.cpp | ||
PrettyStackTrace.cpp | ||
raw_os_ostream.cpp | ||
raw_ostream.cpp | ||
regcclass.h | ||
regcname.h | ||
regcomp.c | ||
regengine.inc | ||
regerror.c | ||
regex2.h | ||
regex_impl.h | ||
Regex.cpp | ||
regexec.c | ||
regfree.c | ||
regstrlcpy.c | ||
regutils.h | ||
SlowOperationInformer.cpp | ||
SmallPtrSet.cpp | ||
SmallVector.cpp | ||
SourceMgr.cpp | ||
Statistic.cpp | ||
StringExtras.cpp | ||
StringMap.cpp | ||
StringPool.cpp | ||
StringRef.cpp | ||
SystemUtils.cpp | ||
TargetRegistry.cpp | ||
Timer.cpp | ||
Triple.cpp | ||
Twine.cpp |