[PATCH] D16604: Disable all standard lib functions for NVVM.
Justin Lebar via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 26 15:55:25 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL258884: Disable all standard lib functions for NVVM. (authored by jlebar).
Changed prior to commit:
http://reviews.llvm.org/D16604?vs=46057&id=46069#toc
Repository:
rL LLVM
http://reviews.llvm.org/D16604
Files:
llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
Index: llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
===================================================================
--- llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
+++ llvm/trunk/lib/Analysis/TargetLibraryInfo.cpp
@@ -385,6 +385,20 @@
TLI.setUnavailable(LibFunc::tmpfile64);
}
+ // As currently implemented in clang, NVPTX code has no standard library to
+ // speak of. Headers provide a standard-ish library implementation, but many
+ // of the signatures are wrong -- for example, many libm functions are not
+ // extern "C".
+ //
+ // libdevice, an IR library provided by nvidia, is linked in by the front-end,
+ // but only used functions are provided to llvm. Moreover, most of the
+ // functions in libdevice don't map precisely to standard library functions.
+ //
+ // FIXME: Having no standard library prevents e.g. many fastmath
+ // optimizations, so this situation should be fixed.
+ if (T.isNVPTX())
+ TLI.disableAllFunctions();
+
TLI.addVectorizableFunctionsFromVecLib(ClVectorLibrary);
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16604.46069.patch
Type: text/x-patch
Size: 1042 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/27ce3fb9/attachment.bin>
More information about the llvm-commits
mailing list