[Bug middle-end/78809] Inline strcmp with small constant strings

qing.zhao at oracle dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 25 16:52:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78809

--- Comment #30 from Qing Zhao <qing.zhao at oracle dot com> ---
(in reply to Wilco from comment #29)
> 
> The new test is better, however it uses i % 15 which means an expensive
> division by constant every loop iteration. It's best to change to i & 15. Also
> using an array of string pointers means you get something like:
> 
> result += strcmp (p[i & 15], "abc");
> 
> Using this I get ~80% speedup for n=3 on AArch64, similar to your set 2.
I will try with these modification. 
> 
> As for benchmarking, I'm not so sure that SPEC2006 or SPEC2017 call strcmp with
> constant strings.
do you have any suggestion on other real applications?


More information about the Gcc-bugs mailing list