llvm-project/llvm
Justin Lebar 49fac56ea3 [NVPTX] Allow libcalls that are defined in the current module.
The patch adds a possibility to make library calls on NVPTX.

An important thing about library functions - they must be defined within
the current module. This basically should guarantee that we produce a
valid PTX assembly (without calls to not defined functions). The one who
wants to use the libcalls is probably will have to link against
compiler-rt or any other implementation.

Currently, it's completely impossible to make library calls because of
error LLVM ERROR: Cannot select: i32 = ExternalSymbol '...'. But we can
lower ExternalSymbol to TargetExternalSymbol and verify if the function
definition is available.

Also, there was an issue with a DAG during legalisation. When we expand
instruction into libcall, the inner call-chain isn't being "integrated"
into outer chain. Since the last "data-flow" (call retval load) node is
located in call-chain earlier than CALLSEQ_END node, the latter becomes
a leaf and therefore a dead node (and is being removed quite fast).
Proposed here solution relies on another data-flow pseudo nodes
(ProxyReg) which purpose is only to keep CALLSEQ_END at legalisation and
instruction selection phases - we remove the pseudo instructions before
register scheduling phase.

Patch by Denys Zariaiev!

Differential Revision: https://reviews.llvm.org/D34708

llvm-svn: 350069
2018-12-26 19:12:31 +00:00
..
benchmarks
bindings
cmake Fix mingw build failures caused by r349839 2018-12-22 03:43:08 +00:00
docs ReleaseNotes: X86 Target: bdver2 sched model was added (D52779) 2018-12-24 12:12:26 +00:00
examples Fix build break from r347239 2018-11-19 18:51:11 +00:00
include [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
lib [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
projects [pstl] Initial integration with LLVM's CMake 2018-12-21 15:59:04 +00:00
resources
runtimes
test [NVPTX] Allow libcalls that are defined in the current module. 2018-12-26 19:12:31 +00:00
tools [llvm-exegesis] Clustering: don't enqueue a point multiple times 2018-12-23 20:48:52 +00:00
unittests [llvm] API for encoding/decoding DWARF discriminators. 2018-12-21 22:48:50 +00:00
utils [gn build] Make NOSORT line actually work 2018-12-24 23:06:29 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt [CMake] Add libunwind when 'all' is being passed as LLVM_ENABLE_PROJECTS 2018-12-20 18:39:47 +00:00
CODE_OWNERS.TXT [llvm-mca] Move llvm-mca library to llvm/lib/MCA. 2018-12-17 08:08:31 +00:00
CREDITS.TXT add Kang Zhang(shkzhang@cn.ibm.com) to the CREDITS.TXT 2018-11-25 02:56:49 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT Update the list of platforms & archs 2018-12-16 14:47:16 +00:00
configure
llvm.spec.in

README.txt

The LLVM Compiler Infrastructure
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.