[all-commits] [llvm/llvm-project] 569969: [Support] Add fast path for StringRef::find with n...

Tatsuyuki Ishi via All-commits all-commits at lists.llvm.org
Sat Oct 8 17:58:38 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5699692dfc7def5c0120258855e43b71e6d1b728
      https://github.com/llvm/llvm-project/commit/5699692dfc7def5c0120258855e43b71e6d1b728
  Author: Tatsuyuki Ishi <ishitatsuyuki at gmail.com>
  Date:   2022-10-09 (Sun, 09 Oct 2022)

  Changed paths:
    M llvm/lib/Support/StringRef.cpp

  Log Message:
  -----------
  [Support] Add fast path for StringRef::find with needle of length 2.

InclusionRewriter on Windows (CRLF line endings) will exercise this in a
hot path. Calling memcmp repeatedly would be highly suboptimal for that
use case, so give it a specialized path.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D133660




More information about the All-commits mailing list