[PATCH] D34708: [NVPTX] Allow to make libcalls that are defined in the current module.

Denys Zariaiev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 02:21:39 PDT 2017


denzp added a comment.

In https://reviews.llvm.org/D34708#792747, @jlebar wrote:

> It's been a while since I've looked at this code, so forgive me, but isn't there a big file somewhere that lists which libcalls each target supports?  Is LLVM going to be unhappy with us if sometimes NVPTX allows libcalls and sometimes it doesn't?


Depending on "operation action" <http://llvm.org/doxygen/NVPTXISelLowering_8cpp_source.html#l00492> some instructions are legal and some are not for the target. Illegal instructions should be expanded into other (probably legal ones) or lowered to libcalls. For example, for i128 values `%a = mul i128 %0, %1` can be expanded into sequence of `mul.lo` and `mul.hi` instructions, but `%a = sdiv i128 %0, %1` can only be lowered into libcall to `__divti3`. And without patch it's completely impossible to perform `sdiv i128`. But now users are able to do it when they provide `__divti3` implementation.

And also some targets has restrictions on libcalls, disabling some of them <http://llvm.org/doxygen/AVRISelLowering_8cpp_source.html#l00177>. But in our case, we don't have any runtime lib (don't we?) so it's up to a user to define the implementations.


https://reviews.llvm.org/D34708





More information about the llvm-commits mailing list