diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-03-26 16:30:54 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-03-26 16:30:54 +0000 |
commit | d683a22dd21424416cb261c2de22520c84977c0f (patch) | |
tree | 19baee28d83ab5c20416fb89af25b0041e3dd208 /llvm/test/CodeGen/X86/stack-align-memcpy.ll | |
parent | a6c8b5121231aee00e229b4247fb8f79141a0aa5 (diff) | |
download | bcm5719-llvm-d683a22dd21424416cb261c2de22520c84977c0f.tar.gz bcm5719-llvm-d683a22dd21424416cb261c2de22520c84977c0f.zip |
Revert "X86 memcpy lowering: use "rep movs" even when esi is used as base pointer" (r204174)
> For functions where esi is used as base pointer, we would previously fall ba
> 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
This didn't work. I was ending up with code like this:
lea edi,[esi+38h]
mov ecx,0Fh
mov edx,esi
mov esi,ebx
rep movs dword ptr es:[edi],dword ptr [esi]
lea ecx,[esi+74h] <-- Ooops, we're now using esi before restoring it from edx.
add ebx,3Ch
mov esi,edx
I guess if we want to do this we need stronger glue or something, or doing the expansion
much later.
llvm-svn: 204829
Diffstat (limited to 'llvm/test/CodeGen/X86/stack-align-memcpy.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/stack-align-memcpy.ll | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/test/CodeGen/X86/stack-align-memcpy.ll b/llvm/test/CodeGen/X86/stack-align-memcpy.ll index d6ea8b31475..0cc3aa84889 100644 --- a/llvm/test/CodeGen/X86/stack-align-memcpy.ll +++ b/llvm/test/CodeGen/X86/stack-align-memcpy.ll @@ -15,9 +15,7 @@ define void @test1(%struct.foo* nocapture %x, i32 %y) nounwind { ; CHECK-LABEL: test1: ; CHECK: andl $-16, %esp ; CHECK: movl %esp, %esi -; CHECK: movl %esi, %edx -; CHECK: rep;movsl -; CHECK: movl %edx, %esi +; CHECK-NOT: rep;movsl } ; PR19012 @@ -30,9 +28,7 @@ define void @test2(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind { ; CHECK-LABEL: test2: ; CHECK: movl %esp, %esi -; CHECK: movl %esi, %edx -; CHECK: rep;movsl -; CHECK: movl %edx, %esi +; CHECK-NOT: rep;movsl } ; Check that we do use rep movs if we make the alloca static. @@ -43,6 +39,5 @@ 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 } |