[Bug string/26852] aarch64/strcmp has performance regression for some cases
wdijkstr at arm dot com
sourceware-bugzilla@sourceware.org
Wed Mar 16 18:53:14 GMT 2022
https://sourceware.org/bugzilla/show_bug.cgi?id=26852
--- Comment #12 from Wilco <wdijkstr at arm dot com> ---
(In reply to Noah Goldstein from comment #11)
> (In reply to Wilco from comment #10)
> > As reported it does also occur in Dhrystone, so it's not due to calling
> > strcmp in a tiny loop. It seems like an issue with the branch predictor not
> > learning to predict certain loops. The question is whether the proposed
> > workaround means all sizes now work without misprediction. Other string
> > functions use small loops as well and compiled code will be affected too, so
> > it's not clear to me there is an easy fix here.
>
> Well whats causing the mispredictions? Clobber in the BHT?
We can't tell from the results - I think that's a question for the CPU
designers.
> By decode I was wondering if there was something like the
> loop-stream-detector in aarch64. On x86 entering the LSD is
> related to code alignment and can cause a spike in branch-misses
> because its implemented s.t the only way to exit LSD decode 'mode'
> is a branch-miss.
AFAIK there is no public description of the microarchitecture, so it may not
even have a loop buffer. If it was something like that, I would expect a slow
down in other cases, not just for exactly 3 iterations.
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list