[Bug tree-optimization/115777] [12/13/14/15 regression] Severe performance regression on insertion sort at -O2 or above
sjames at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Jul 3 21:38:32 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115777
--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
11 vs 12:
```
--- /dev/fd/63 2024-07-03 22:38:09.929726424 +0100
+++ /dev/fd/62 2024-07-03 22:38:09.932726456 +0100
@@ -5,24 +5,28 @@
insertion_sort.constprop.0:
.LFB25:
.cfi_startproc
- leaq 4(%rdi), %r8
+ movq %rdi, %r8
movl $1, %esi
.p2align 4,,10
.p2align 3
.L2:
- movq %r8, %rax
+ movq %r8, %rdx
+ jmp .L3
.p2align 4,,10
.p2align 3
+.L5:
+ vmovq %xmm1, (%rdx)
+ leaq -4(%rdx), %rax
+ cmpq %rdi, %rdx
+ je .L6
+ movq %rax, %rdx
.L3:
- movl -4(%rax), %edx
- movl (%rax), %ecx
- cmpl %edx, %ecx
- jnb .L6
- movl %ecx, -4(%rax)
- subq $4, %rax
- movl %edx, 4(%rax)
- cmpq %rax, %rdi
- jne .L3
+ vmovq (%rdx), %xmm0
+ vmovd %xmm0, %ecx
+ vpextrd $1, %xmm0, %eax
+ vpshufd $225, %xmm0, %xmm1
+ cmpl %ecx, %eax
+ jb .L5
.L6:
addq $1, %rsi
addq $4, %r8
@@ -77,7 +81,7 @@
vzeroupper
call clock@PLT
leaq .LC0(%rip), %rsi
- movl $1, %edi
+ movl $2, %edi
subq %rbx, %rax
movq %rax, %rdx
xorl %eax, %eax
```
More information about the Gcc-bugs
mailing list