[llvm] r252535 - [TargetLibraryInfo] Add support for fls, flsl, flsll.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 9 15:23:21 PST 2015
Author: davide
Date: Mon Nov 9 17:23:20 2015
New Revision: 252535
URL: http://llvm.org/viewvc/llvm-project?rev=252535&view=rev
Log:
[TargetLibraryInfo] Add support for fls, flsl, flsll.
This is a prerequisite for further optimisations of these functions,
which will be commited as a separate patch.
Differential Revision: http://reviews.llvm.org/D14219
Modified:
llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def?rev=252535&r1=252534&r2=252535&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def (original)
+++ llvm/trunk/include/llvm/Analysis/TargetLibraryInfo.def Mon Nov 9 17:23:20 2015
@@ -406,6 +406,15 @@ TLI_DEFINE_STRING_INTERNAL("floorf")
/// long double floorl(long double x);
TLI_DEFINE_ENUM_INTERNAL(floorl)
TLI_DEFINE_STRING_INTERNAL("floorl")
+/// int fls(int i);
+TLI_DEFINE_ENUM_INTERNAL(fls)
+TLI_DEFINE_STRING_INTERNAL("fls")
+/// int flsl(long int i);
+TLI_DEFINE_ENUM_INTERNAL(flsl)
+TLI_DEFINE_STRING_INTERNAL("flsl")
+/// int flsll(long long int i);
+TLI_DEFINE_ENUM_INTERNAL(flsll)
+TLI_DEFINE_STRING_INTERNAL("flsll")
/// double fmax(double x, double y);
TLI_DEFINE_ENUM_INTERNAL(fmax)
TLI_DEFINE_STRING_INTERNAL("fmax")
Modified: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp?rev=252535&r1=252534&r2=252535&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp Mon Nov 9 17:23:20 2015
@@ -350,6 +350,16 @@ static void initialize(TargetLibraryInfo
TLI.setUnavailable(LibFunc::ffsll);
}
+ // The following functions are available on at least FreeBSD:
+ // http://svn.freebsd.org/base/head/lib/libc/string/fls.c
+ // http://svn.freebsd.org/base/head/lib/libc/string/flsl.c
+ // http://svn.freebsd.org/base/head/lib/libc/string/flsll.c
+ if (!T.isOSFreeBSD()) {
+ TLI.setUnavailable(LibFunc::fls);
+ TLI.setUnavailable(LibFunc::flsl);
+ TLI.setUnavailable(LibFunc::flsll);
+ }
+
// The following functions are available on at least Linux:
if (!T.isOSLinux()) {
TLI.setUnavailable(LibFunc::dunder_strdup);
More information about the llvm-commits
mailing list