diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-03-18 20:04:34 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-03-18 20:04:34 +0000 |
commit | 523f800e90f21861a5b6bb9f7c432c8799168bde (patch) | |
tree | b2894a46095eb1dde65307e5e09f8318c6330c14 /test/CodeGen/X86/stack-align-memcpy.ll | |
parent | 172c31844b3b8216313bcb7b7e20ad8ecbc71d5f (diff) | |
download | llvm-523f800e90f21861a5b6bb9f7c432c8799168bde.tar.gz llvm-523f800e90f21861a5b6bb9f7c432c8799168bde.tar.bz2 llvm-523f800e90f21861a5b6bb9f7c432c8799168bde.tar.xz |
X86 memcpy lowering: use "rep movs" even when esi is used as base pointer
For functions where esi is used as base pointer, we would previously fall back
from lowering memcpy with "rep movs" because that clobbers esi.
With this patch, we just store esi in another physical register, and restore
it afterwards. This adds a little bit of register preassure, but the more
efficient memcpy should be worth it.
Differential Revision: http://llvm-reviews.chandlerc.com/D2968
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204174 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/X86/stack-align-memcpy.ll')
-rw-r--r-- | test/CodeGen/X86/stack-align-memcpy.ll | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/CodeGen/X86/stack-align-memcpy.ll b/test/CodeGen/X86/stack-align-memcpy.ll index 0cc3aa8488..d6ea8b3147 100644 --- a/test/CodeGen/X86/stack-align-memcpy.ll +++ b/test/CodeGen/X86/stack-align-memcpy.ll @@ -15,7 +15,9 @@ define void @test1(%struct.foo* nocapture %x, i32 %y) nounwind { ; CHECK-LABEL: test1: ; CHECK: andl $-16, %esp ; CHECK: movl %esp, %esi -; CHECK-NOT: rep;movsl +; CHECK: movl %esi, %edx +; CHECK: rep;movsl +; CHECK: movl %edx, %esi } ; PR19012 @@ -28,7 +30,9 @@ define void @test2(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind { ; CHECK-LABEL: test2: ; CHECK: movl %esp, %esi -; CHECK-NOT: rep;movsl +; CHECK: movl %esi, %edx +; CHECK: rep;movsl +; CHECK: movl %edx, %esi } ; Check that we do use rep movs if we make the alloca static. @@ -39,5 +43,6 @@ define void @test3(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind { ret void ; CHECK-LABEL: test3: +; CHECK-NOT: movl %esi, %edx ; CHECK: rep;movsl } |