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 | aec21ce43e7fa7e0f45eb3ebfd0761076f881ea3 (patch) | |
| tree | eb00f1d1a70e8e8a5098a9f415749b8dfa27acef /llvm/test | |
| parent | 34b26458cbfe810e1cc8b6a7cfdc9cb8338e90cf (diff) | |
| download | bcm5719-llvm-aec21ce43e7fa7e0f45eb3ebfd0761076f881ea3.tar.gz bcm5719-llvm-aec21ce43e7fa7e0f45eb3ebfd0761076f881ea3.zip | |
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
llvm-svn: 204174
Diffstat (limited to 'llvm/test')
| -rw-r--r-- | llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/stack-align-memcpy.ll | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll b/llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll index b55571bcba0..f64ccb84683 100644 --- a/llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll +++ b/llvm/test/CodeGen/X86/inline-asm-sp-clobber-memcpy.ll @@ -13,5 +13,7 @@ define void @test1(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind { ; CHECK-LABEL: test1: ; CHECK: movl %esp, %esi -; CHECK-NOT: rep;movsl +; CHECK: movl %esi, %edx +; CHECK: rep;movsl +; CHECK: movl %edx, %esi } diff --git a/llvm/test/CodeGen/X86/stack-align-memcpy.ll b/llvm/test/CodeGen/X86/stack-align-memcpy.ll index 0cc3aa84889..d6ea8b31475 100644 --- a/llvm/test/CodeGen/X86/stack-align-memcpy.ll +++ b/llvm/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 } |

