| Issue |
183003
|
| Summary |
`memcmp` -> `bcmp` optimization not firing when fed to bitwise or
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
zygoloid
|
Testcase:
```c++
char *p;
bool b;
int main() {
b |= __builtin_memcmp(p, "1234567", 7);
}
```
This produces unnecessarily slow code, which computes not only whether the strings are equal but also whether they are greater or less: https://godbolt.org/z/Tf71qovK3
It looks like the transform from the `memcmp` to `bcmp` lib function is not firing here, though it should be able to.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs