diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-28 05:34:27 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-28 05:34:27 +0000 |
commit | a672d3d0e1bde3691751e3e6c65c9afb5980ba0a (patch) | |
tree | bdce8ade23602f7a91897415af35756a0ecf56d9 /lib/Target | |
parent | 44a98ac8837a425418444b9ca02f009127b360be (diff) | |
download | external_llvm-a672d3d0e1bde3691751e3e6c65c9afb5980ba0a.zip external_llvm-a672d3d0e1bde3691751e3e6c65c9afb5980ba0a.tar.gz external_llvm-a672d3d0e1bde3691751e3e6c65c9afb5980ba0a.tar.bz2 |
target-indep codegen memcpy lowering issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/README.txt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/Target/README.txt b/lib/Target/README.txt index ef63b9f..0096b0f 100644 --- a/lib/Target/README.txt +++ b/lib/Target/README.txt @@ -628,3 +628,47 @@ to know that it doesn't modify G either. This is very tricky. We should add an FRINT node to the DAG to model targets that have legal implementations of ceil/floor/rint. + +//===---------------------------------------------------------------------===// + +Consider: + +int test() { + long long input[8] = {1,1,1,1,1,1,1,1}; + foo(input); +} + +We currently compile this into a memcpy from a global array since the +initializer is fairly large and not memset'able. This is good, but the memcpy +gets lowered to load/stores in the code generator. This is also ok, except +that the codegen lowering for memcpy doesn't handle the case when the source +is a constant global. This gives us atrocious code like this: + + call "L1$pb" +"L1$pb": + popl %eax + movl _C.0.1444-"L1$pb"+32(%eax), %ecx + movl %ecx, 40(%esp) + movl _C.0.1444-"L1$pb"+20(%eax), %ecx + movl %ecx, 28(%esp) + movl _C.0.1444-"L1$pb"+36(%eax), %ecx + movl %ecx, 44(%esp) + movl _C.0.1444-"L1$pb"+44(%eax), %ecx + movl %ecx, 52(%esp) + movl _C.0.1444-"L1$pb"+40(%eax), %ecx + movl %ecx, 48(%esp) + movl _C.0.1444-"L1$pb"+12(%eax), %ecx + movl %ecx, 20(%esp) + movl _C.0.1444-"L1$pb"+4(%eax), %ecx +... + +instead of: + movl $1, 16(%esp) + movl $0, 20(%esp) + movl $1, 24(%esp) + movl $0, 28(%esp) + movl $1, 32(%esp) + movl $0, 36(%esp) + ... + +//===---------------------------------------------------------------------===// |