mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Mirror of https://github.com/RPCS3/llvm-mirror
b9f858943a
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. llvm-svn: 103107 |
||
---|---|---|
autoconf | ||
bindings | ||
cmake | ||
docs | ||
examples | ||
include | ||
lib | ||
projects | ||
runtime | ||
test | ||
tools | ||
unittests | ||
utils | ||
website | ||
build-for-llvm-top.sh | ||
CMakeLists.txt | ||
configure | ||
CREDITS.TXT | ||
LICENSE.TXT | ||
llvm.spec.in | ||
Makefile | ||
Makefile.common | ||
Makefile.config.in | ||
Makefile.rules | ||
ModuleInfo.txt | ||
README.txt |
Low Level Virtual Machine (LLVM) ================================ This directory and its subdirectories contain source code for the Low Level Virtual Machine, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. Please see the HTML documentation provided in docs/index.html for further assistance with LLVM. If you're writing a package for LLVM, see docs/Packaging.html for our suggestions.