David Bolvansky
|
909889b2cb
|
[InstCombine] Transform str(n)cmp to memcmp
Summary:
Motivation examples:
int strcmp_memcmp() {
char buf[12];
return strcmp(buf, "key") == 0;
}
int strcmp_memcmp2() {
char buf[12];
return strcmp(buf, "key") != 0;
}
int strncmp_memcmp() {
char buf[12];
return strncmp(buf, "key", 3) == 0;
}
can be turned to memcmp.
See test file for more cases.
Reviewers: efriedma
Reviewed By: efriedma
Subscribers: spatel, llvm-commits
Differential Revision: https://reviews.llvm.org/D50233
llvm-svn: 339410
|
2018-08-10 04:32:54 +00:00 |