simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 16 Jun 2010 10:30:29 +0000 (10:30 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 16 Jun 2010 10:30:29 +0000 (10:30 +0000)
commitea9ca0236d758967b40d3dd18054e90d65151674
tree81e28bf6bd992d559b95ca9aea0ed4662c29ef5b
parent46df4eb46e784036cf895db271fe29e1cf2a975a
simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)

The memcmp will be optimized further and even the pathological case
'strstr(x, "x") == x' generates optimal code now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106097 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SimplifyLibCalls.cpp
test/Transforms/SimplifyLibCalls/StrNCmp.ll