Issue 157064
Summary LLVM could avoid calling memcmp when the maximum lenght is 1
Labels new issue
Assignees
Reporter philnik777
    ```
auto test1(const char* str, unsigned len) {
  auto cmp_len = len == 0 ? 0 : 1;
  return __builtin_memcmp("a", str, cmp_len);
}
```
results in a memcmp call, even though it's almost certainly faster to inline the `memcmp` call, especially when the place where the result is used is available.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to