TLI: Microoptimize calls to strlen+memcmp to strncmp.
authorBenjamin Kramer <benny.kra@googlemail.com>
Sat, 9 Mar 2013 13:48:23 +0000 (13:48 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Sat, 9 Mar 2013 13:48:23 +0000 (13:48 +0000)
commit576f62c1ead0c099aacf2bc08552a1348d57c23f
tree1aad4df5285fe70870363dc8e38d52a4009f94a1
parente629a33d166f55a916f40a1feae47af8ab97feed
TLI: Microoptimize calls to strlen+memcmp to strncmp.

The strlen+memcmp was hidden in a call to StringRef::operator==. We check if
there are any null bytes in the string upfront so we can simplify the comparison
Small speedup when compiling code with many function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176766 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/TargetLibraryInfo.cpp