https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118012
cuilili <lili.cui at intel dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |lili.cui at intel dot com
--- Comment #33 from cuilili <lili.cui at intel dot com> ---
On GCC 13.5, r13-4459 causes a 4.1% CoreMark regression on ADL
(P-core). It is caused by the second sequence (and/neg/and/xor) having
a longer dependency chain on the loop-carried crc. crcu8 inner loop,
GCC 13.5 -O2:
before r13-4459: after r13-4459:
.L3: .L2:
movl %edi, %esi movl %edi, %edx
shrb %dil shrb %dil
xorl %eax, %esi c xorl %eax, %edx *
shrw %ax v shrw %ax
movl %eax, %ecx v andl $1, %edx *
xorw $-24575, %cx v negl %edx *
andl $1, %esi c andw $-24575, %dx *
cmovne %ecx, %eax c v xorl %edx, %eax *
subb $1, %dl subb $1, %cl
jne .L3 jne .L2
before: c = condition, v = value (in parallel), dependency chain 4 cycles
after: * = serial, dependency chain 5 cycles
AArch64 has a similar issue: csel is replaced by a longer
sbfx/and/eor chain (trunk -O2 -fno-optimize-crc, codegen only).
Also, as Siddhesh said, trunk produces different code here: trunk is
4.9% faster than the pre-r13-4459 baseline, because -foptimize-crc
(GCC 15) replaces crcu8 with .CRC_REV (a table lookup on x86) before
the select is folded.