[PATCH] D45571: [ELF] - Speedup MergeInputSection::splitStrings

Rafael Avila de Espindola via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 19 18:46:36 PDT 2018


espindola added a comment.

In https://reviews.llvm.org/D45571#1071365, @ruiu wrote:

> I believe a fast strlen() can be implemented using SSE instructions. And if you are using SSE instructions, your data is loaded to XMM registers. I believe there exists a fast vectorized hash function that works on data on a XMM register. I wonder if we can combine the two to create a single fast function that returns the length of a string as well as its hash value.


Probably, but I would suggest not going that far in the first patch. Also note that we can use a memchr ,which is a bit easier than strlen. The hash_value in llvm uses 64 bits at a time. Given that using a byte at a time djbhash was already a small speedup, using 64 bits at a time for a combined memchr and hash should be very helpful.


https://reviews.llvm.org/D45571





More information about the llvm-commits mailing list