From 002be767333e4253df6c5477dda28890dbd3488c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 16 Mar 2004 03:41:35 +0000 Subject: [PATCH] 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 --- lib/Analysis/BasicAliasAnalysis.cpp | 22 ++++++++++++++++++++-- lib/Analysis/LoadValueNumbering.cpp | 2 +- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp index 9b6258edd3f..4a8a6803646 100644 --- a/lib/Analysis/BasicAliasAnalysis.cpp +++ b/lib/Analysis/BasicAliasAnalysis.cpp @@ -607,6 +607,17 @@ static const char *DoesntAccessMemoryTable[] = { "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 @@ bool BasicAliasAnalysis::doesNotAccessMemory(Function *F) { 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 a71ade6d614..b67aaddde32 100644 --- a/lib/Analysis/LoadValueNumbering.cpp +++ b/lib/Analysis/LoadValueNumbering.cpp @@ -247,7 +247,7 @@ void LoadVN::getEqualNumberNodes(Value *V, if (!isa(V)) { if (CallInst *CI = dyn_cast(V)) - return getCallEqualNumberNodes(CI, RetVals); + getCallEqualNumberNodes(CI, RetVals); // Not a load instruction? Just chain to the base value numbering // implementation to satisfy the request...