Add some missing functions.  Make sure to handle calls together in case the
client has another VN implementation that can VN calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12427 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 9b6258e..4a8a680 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -607,6 +607,17 @@
   "iswctype", "towctrans", "towlower", "towupper", 
 
   "btowc", "wctob", 
+
+  "isinf", "isnan", "finite",
+
+  // C99 math functions
+  "copysign", "copysignf", "copysignd",
+  "nexttoward", "nexttowardf", "nexttowardd",
+  "nextafter", "nextafterf", "nextafterd",
+
+  // glibc functions:
+  "__fpclassify", "__fpclassifyf", "__fpclassifyl",
+  "__signbit", "__signbitf", "__signbitl",
 };
 
 static const unsigned DAMTableSize =
@@ -636,16 +647,23 @@
 
 
 static const char *OnlyReadsMemoryTable[] = {
-  "atoi", "atol", "atof", "atoll", "atoq",
-  "bcmp", "memcmp", "memchr", "wmemcmp", "wmemchr", 
+  "atoi", "atol", "atof", "atoll", "atoq", "a64l",
+  "bcmp", "memcmp", "memchr", "memrchr", "wmemcmp", "wmemchr", 
 
   // Strings
   "strcmp", "strcasecmp", "strcoll", "strncmp", "strncasecmp",
   "strchr", "strcspn", "strlen", "strpbrk", "strrchr", "strspn", "strstr", 
+  "index", "rindex",
 
   // Wide char strings
   "wcschr", "wcscmp", "wcscoll", "wcscspn", "wcslen", "wcsncmp", "wcspbrk",
   "wcsrchr", "wcsspn", "wcsstr", 
+
+  // glibc
+  "alphasort", "alphasort64", "versionsort", "versionsort64",
+
+  // C99
+  "nan", "nanf", "nand",
 };
 
 static const unsigned ORMTableSize =
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index a71ade6..b67aadd 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -247,7 +247,7 @@
 
   if (!isa<LoadInst>(V)) {
     if (CallInst *CI = dyn_cast<CallInst>(V))
-      return getCallEqualNumberNodes(CI, RetVals);
+      getCallEqualNumberNodes(CI, RetVals);
 
     // Not a load instruction?  Just chain to the base value numbering
     // implementation to satisfy the request...