[PATCH] D88460: Strlen loop idiom recognition

Aditya Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 27 12:15:35 PST 2023


hiraditya added a comment.

Can this patch also convert this one to strlen? gcc is able to recognize this idiom: https://godbolt.org/z/7ra1ErqKK

  size_t strlen2(char *Str) {
      char *Src = Str;
      int i = 0;
      while (*Src) {
          ++i;
          ++Src;
      }
      return i;
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88460/new/

https://reviews.llvm.org/D88460



More information about the llvm-commits mailing list