mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
This patch adds an outline to begin adding a `libmgpu.a` file for provindg math on the GPU. Currently, this is most likely going to be wrapping around existing vendor libraries and placing them in a more usable format. Long term, we would like to provide our own implementations of math functions that can be used instead. This patch works by simply forwarding the calls to the standard C math library calls like `sin` to the appropriate vendor call like `__nv_sin`. Currently, we will use the vendor libraries directly and link them in via `-mlink-builtin-bitcode`. This is necessary because of bizarre interactions with the generic bitcode, `-mlink-builtin-bitcode` internalizes and only links in the used symbols, furthermore is propagates the target's default attributes and its the only "truly" correct way to pull in these vendor bitcode libraries without error. If the vendor libraries are not availible at build time, we will still create the `libmgpu.a`, but we will expect that the vendor library definitions will be provided by the user's compilation as is made possible by https://reviews.llvm.org/D152442. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D152486
LLVM libc ========= This directory and its subdirectories contain source code for llvm-libc, a retargetable implementation of the C standard library. LLVM is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt.