[PATCH] D126515: [InstCombine] Fold memchr of sequences of same characters

Martin Sebor via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 26 19:04:27 PDT 2022


msebor created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
msebor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change enhances the `memchr` library function handler to fold calls with one or two consecutive sequences of the same character, analogously to the corresponding feature recently added to the `memrchr` handler (D123631 <https://reviews.llvm.org/D123631>).  Rather than just one sequence as for `memrchr`, this one handles also two sequences in order to also benefit `strchr`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126515

Files:
  llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
  llvm/test/Transforms/InstCombine/memchr-6.ll
  llvm/test/Transforms/InstCombine/memchr.ll
  llvm/test/Transforms/InstCombine/strchr-3.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126515.432440.patch
Type: text/x-patch
Size: 17798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220527/49d10899/attachment.bin>


More information about the llvm-commits mailing list