[llvm-dev] [RFC] Strlen loop idiom recognition/folding

Muhammad Usman via llvm-dev llvm-dev at lists.llvm.org
Wed Jul 8 06:43:49 PDT 2020


Hi all,

This patch (https://reviews.llvm.org/D83392) extends loop idiom recognize
by including the recognition of strlen and transforming it to a function
call. It is the first part of 3 patches: the second patch will also
identify strlens of 16 bit char length and replace them with a new strlen16
intrinsic. The third patch would see if any strlen/strlen16 are only used
in zero equality comparisons, and if so, fold them to a load of the first
element (giving some performance benefits). If a call to strlen16 intrinsic
cannot be folded, it would be expanded back out to the canonical loop form.

Any comments about this would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200708/a8899c05/attachment.html>


More information about the llvm-dev mailing list