mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-03 15:26:18 +00:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user