[all-commits] [llvm/llvm-project] 178a1f: [libc++] Optimize string operator[] for known larg...

Ilya Tocar via All-commits all-commits at lists.llvm.org
Thu Oct 26 10:09:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 178a1fea57b542c39de79624662085f86f3e348f
      https://github.com/llvm/llvm-project/commit/178a1fea57b542c39de79624662085f86f3e348f
  Author: Ilya Tocar <tokarip at google.com>
  Date:   2023-10-26 (Thu, 26 Oct 2023)

  Changed paths:
    M libcxx/include/string
    M libcxx/test/std/strings/basic.string/string.access/index.pass.cpp

  Log Message:
  -----------
  [libc++] Optimize string operator[] for known large inputs (#69500)

If we know that index is larger than SSO size, we know that we can't be
in SSO case, and should access the pointer. This removes extra check
from operator[] for inputs known at compile time to be larger than SSO.




More information about the All-commits mailing list