llvm-project/llvm
Yaxun Liu de4b88d9a1 [AMDGPU] Lower enqueued blocks and generate runtime metadata
This patch adds a post-linking pass which replaces the function pointer of enqueued
block kernel with a global variable (runtime handle) and adds
runtime-handle attribute to the enqueued block kernel.

In LLVM CodeGen the runtime-handle metadata will be translated to
RuntimeHandle metadata in code object. Runtime allocates a global buffer
for each kernel with RuntimeHandel metadata and saves the kernel address
required for the AQL packet into the buffer. __enqueue_kernel function
in device library knows that the invoke function pointer in the block
literal is actually runtime handle and loads the kernel address from it
and puts it into AQL packet for dispatching.

This cannot be done in FE since FE cannot create a unique global variable
with external linkage across LLVM modules. The global variable with internal
linkage does not work since optimization passes will try to replace loads
of the global variable with its initialization value.

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

llvm-svn: 315352
2017-10-10 19:39:48 +00:00
..
bindings
cmake Bring r314809 back. 2017-10-04 20:27:01 +00:00
docs [AMDGPU] Lower enqueued blocks and generate runtime metadata 2017-10-10 19:39:48 +00:00
examples Fix broken links to the Itanium CXX ABI 2017-09-12 00:19:11 +00:00
include [AMDGPU] Lower enqueued blocks and generate runtime metadata 2017-10-10 19:39:48 +00:00
lib [AMDGPU] Lower enqueued blocks and generate runtime metadata 2017-10-10 19:39:48 +00:00
projects
resources
runtimes [CMake][runtimes] Use the same configuration for non-target and "default" target 2017-09-08 22:26:50 +00:00
test [AMDGPU] Lower enqueued blocks and generate runtime metadata 2017-10-10 19:39:48 +00:00
tools [opt-viewer] Don't Decode HTML bytes for Python 2 2017-10-10 19:34:15 +00:00
unittests Remove unused variables. No functionality change. 2017-10-08 21:23:02 +00:00
utils [lit] Only enable LSan on darwin when clang supports it 2017-10-10 17:21:32 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Revert "[CMake] Remove `CMAKE_.*_OUTPUT_DIRECTORY` (NFCI)" 2017-09-29 19:50:41 +00:00
CODE_OWNERS.TXT
CREDITS.TXT Add myself to CREDITS.txt 2017-09-18 14:33:39 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

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.