Patchwork [1/7] Remove dead code from memcpy-sse2-unaligned.S

login
register
mail settings
Submitter H.J. Lu
Date March 7, 2016, 5:36 p.m.
Message ID <1457372190-12196-2-git-send-email-hjl.tools@gmail.com>
Download mbox | patch
Permalink /patch/11236/
State New
Headers show

Comments

H.J. Lu - March 7, 2016, 5:36 p.m.
There are

ENTRY(__memcpy_sse2_unaligned)
   movq  %rsi, %rax
   leaq  (%rdx,%rdx), %rcx
   subq  %rdi, %rax
   subq  %rdx, %rax
   cmpq  %rcx, %rax
   jb L(overlapping)

When branch is taken,

   cmpq  %rsi, %rdi
   jae   .L3

will never be taken.  We can remove the dead code.

	[BZ #19776]
	* sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S (.L3) Removed.
---
 sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S | 11 -----------
 1 file changed, 11 deletions(-)

Patch

diff --git a/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S b/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S
index c450983..7207753 100644
--- a/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S
+++ b/sysdeps/x86_64/multiarch/memcpy-sse2-unaligned.S
@@ -90,8 +90,6 @@  L(loop):
 	jne	L(loop)
 	jmp	L(return)
 L(overlapping):
-	cmpq	%rsi, %rdi
-	jae	.L3
 	testq	%rdx, %rdx
 	.p2align 4,,5
 	je	L(return)
@@ -146,15 +144,6 @@  L(less_16):
 	movzwl	-2(%rsi,%rdx), %eax
 	movw	%ax, -2(%rdi,%rdx)
 	jmp	L(return)
-.L3:
-	leaq	-1(%rdx), %rax
-	.p2align 4,,10
-	.p2align 4
-.L11:
-	movzbl	(%rsi,%rax), %edx
-	movb	%dl, (%rdi,%rax)
-	subq	$1, %rax
-	jmp	.L11
 L(between_9_16):
 	movq	(%rsi), %rax
 	movq	%rax, (%rdi)