1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-26 04:32:44 +01:00
llvm-mirror/tools
Lang Hames efc9f3486a [ORC] Add support for resource tracking/removal (removable code).
This patch introduces new APIs to support resource tracking and removal in Orc.
It is intended as a thread-safe generalization of the removeModule concept from
OrcV1.

Clients can now create ResourceTracker objects (using
JITDylib::createResourceTracker) to track resources for each MaterializationUnit
(code, data, aliases, absolute symbols, etc.) added to the JIT. Every
MaterializationUnit will be associated with a ResourceTracker, and
ResourceTrackers can be re-used for multiple MaterializationUnits. Each JITDylib
has a default ResourceTracker that will be used for MaterializationUnits added
to that JITDylib if no ResourceTracker is explicitly specified.

Two operations can be performed on ResourceTrackers: transferTo and remove. The
transferTo operation transfers tracking of the resources to a different
ResourceTracker object, allowing ResourceTrackers to be merged to reduce
administrative overhead (the source tracker is invalidated in the process). The
remove operation removes all resources associated with a ResourceTracker,
including any symbols defined by MaterializationUnits associated with the
tracker, and also invalidates the tracker. These operations are thread safe, and
should work regardless of the the state of the MaterializationUnits. In the case
of resource transfer any existing resources associated with the source tracker
will be transferred to the destination tracker, and all future resources for
those units will be automatically associated with the destination tracker. In
the case of resource removal all already-allocated resources will be
deallocated, any if any program representations associated with the tracker have
not been compiled yet they will be destroyed. If any program representations are
currently being compiled then they will be prevented from completing: their
MaterializationResponsibility will return errors on any attempt to update the
JIT state.

Clients (usually Layer writers) wishing to track resources can implement the
ResourceManager API to receive notifications when ResourceTrackers are
transferred or removed. The MaterializationResponsibility::withResourceKeyDo
method can be used to create associations between the key for a ResourceTracker
and an allocated resource in a thread-safe way.

RTDyldObjectLinkingLayer and ObjectLinkingLayer are updated to use the
ResourceManager API to enable tracking and removal of memory allocated by the
JIT linker.

The new JITDylib::clear method can be used to trigger removal of every
ResourceTracker associated with the JITDylib (note that this will only
remove resources for the JITDylib, it does not run static destructors).

This patch includes unit tests showing basic usage. A follow-up patch will
update the Kaleidoscope and BuildingAJIT tutorial series to OrcV2 and will
use this API to release code associated with anonymous expressions.
2020-10-18 21:02:54 -07:00
..
bugpoint [bugpoint] Delete -safe-llc and make -run-llc work like -run-llc -safe-run-llc 2020-10-09 16:38:30 -07:00
bugpoint-passes Reverted the remainings of c1c9819ef91aab51b5a23fb3027adac5a2f551cc 2020-02-11 16:20:06 -08:00
dsymutil [dsymutil] Fix handling of aliases to private external symbols 2020-10-14 20:18:56 -07:00
gold [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llc [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
lli [ORC] Remove OrcV1 APIs. 2020-10-18 21:02:44 -07:00
llvm-ar Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-as [opt] Remove obsolete --quiet option 2020-07-08 13:21:20 -07:00
llvm-as-fuzzer Fix several places that were calling verifyFunction or verifyModule without checking the return value. 2020-05-18 13:28:46 -07:00
llvm-bcanalyzer Revert "Remove redundant "std::move"s in return statements" 2020-02-10 07:07:40 -08:00
llvm-c-test [ORC] Remove OrcV1 APIs. 2020-10-18 21:02:44 -07:00
llvm-cat
llvm-cfi-verify Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-config [MinGW] Use lib prefix for libraries 2020-09-12 22:01:29 +03:00
llvm-cov Revert "[llvm-cov] don't include all source files when provided source files are filtered out" 2020-10-16 13:46:12 +01:00
llvm-cvtres Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-cxxdump [llvm/Object] - Make ELFObjectFile::getRelocatedSection return Expected<section_iterator> 2019-10-21 11:06:38 +00:00
llvm-cxxfilt Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
llvm-cxxmap
llvm-diff llvm-diff: Avoid crash with complex expressions 2020-05-21 17:43:47 -04:00
llvm-dis [llvm-dis] Fix the disable-output flag 2019-11-14 13:35:21 -08:00
llvm-dwarfdump llvm-dwarfdump: Exit non-zero on an error path 2020-10-14 22:10:43 -07:00
llvm-dwp Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-elfabi [elfabi] Move llvm-elfabi related code to InterfaceStub library 2020-08-13 11:51:44 -07:00
llvm-exegesis Reland rG4fcd1a8e6528:[llvm-exegesis] Add option to check the hardware support for a given feature before benchmarking. 2020-10-01 12:21:16 -04:00
llvm-extract [opt] Remove obsolete --quiet option 2020-07-08 13:21:20 -07:00
llvm-go Reinstate llvm-go to test the go bindings. 2020-02-13 17:24:55 -08:00
llvm-gsymutil Fix GSYM tests to run the yaml files and fix test failures on some machines. 2020-03-04 19:14:08 -08:00
llvm-ifs Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-isel-fuzzer [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llvm-itanium-demangle-fuzzer
llvm-jitlink [ORC] Add support for resource tracking/removal (removable code). 2020-10-18 21:02:54 -07:00
llvm-jitlistener
llvm-libtool-darwin [Object][MachO] Refine the interface of Slice 2020-09-25 16:27:45 -07:00
llvm-link llvm-link: Add support for archive files as inputs 2020-07-14 15:30:59 -04:00
llvm-lipo [Object][MachO] Refine the interface of Slice 2020-09-25 16:27:45 -07:00
llvm-lto [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llvm-lto2 [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llvm-mc [ms] [llvm-ml] Add MASM hex float support 2020-09-29 16:57:32 -04:00
llvm-mc-assemble-fuzzer Add missing include Host.h in llvm-mc-* fuzzers. NFC. 2020-05-18 02:21:22 +07:00
llvm-mc-disassemble-fuzzer Add missing include Host.h in llvm-mc-* fuzzers. NFC. 2020-05-18 02:21:22 +07:00
llvm-mca [llvm-mca][NFC] Refactor handling of views that examine individual instructions, 2020-08-25 12:12:37 -07:00
llvm-microsoft-demangle-fuzzer Give microsoftDemangle() an outparam for how many input bytes were consumed. 2020-05-20 16:17:31 -04:00
llvm-ml [ms] [llvm-ml] Create the @feat.00 symbol, and populate it appropriately 2020-09-29 17:02:27 -04:00
llvm-modextract
llvm-mt Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-nm [llvm-nm] Use aggregate initialization instead of memset zero 2020-09-16 10:27:12 -07:00
llvm-objcopy [llvm-install-name-tool] Add -delete_all_rpaths option 2020-10-13 00:45:57 -07:00
llvm-objdump [objdump][macho] Check arch before formating reloc name as arm64 addend 2020-10-16 14:30:22 -07:00
llvm-opt-fuzzer [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
llvm-opt-report Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
llvm-pdbutil [llvm][NFC] Add missing 'override's 2020-07-17 17:35:59 -07:00
llvm-profdata [llvm-profdata]Fix llvm-profdata crash on compact binary profile 2020-09-20 16:58:34 -07:00
llvm-rc [llvm-rc] Lowercase the option definitions. NFC. 2020-09-16 09:34:26 +03:00
llvm-readobj Fix various format specifier mismatches 2020-10-18 12:39:15 -04:00
llvm-reduce llvm-reduce: Don't replace intrinsic calls with undef 2020-10-16 10:10:53 -04:00
llvm-rtdyld Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
llvm-shlib [Support] On Windows, add optional support for {rpmalloc|snmalloc|mimalloc} 2020-08-27 11:09:46 -04:00
llvm-size [llvm-size] Output REL, RELA and STRTAB sections when allocatable 2020-07-01 12:02:32 +01:00
llvm-special-case-list-fuzzer
llvm-split Fix several places that were calling verifyFunction or verifyModule without checking the return value. 2020-05-18 13:28:46 -07:00
llvm-stress [SVE] Remove calls to VectorType::getNumElements() from llvm-stress 2020-08-31 15:51:15 -07:00
llvm-strings
llvm-symbolizer llvm-symbolizer: Exit non-zero when DWARF parsing errors have been rendered 2020-10-14 23:42:00 -07:00
llvm-undname Give microsoftDemangle() an outparam for how many input bytes were consumed. 2020-05-20 16:17:31 -04:00
llvm-xray Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
llvm-yaml-numeric-parser-fuzzer
lto [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
msbuild
obj2yaml [yaml2obj/obj2yaml] - Add support of 'Size' and 'Content' keys for all sections. 2020-10-15 11:11:41 +03:00
opt [AIX] Turn -fdata-sections on by default in Clang 2020-10-14 15:58:31 +00:00
opt-viewer Convert old python3 cgi method into the new html one 2020-03-25 22:38:55 +01:00
remarks-shlib [tools][remarks-shlib] Don't build libRemarks.so without PIC 2020-09-20 12:40:21 +02:00
sancov [Support] Use InitLLVM in llvm-stress, sancov and TableGen 2020-07-28 07:50:45 -04:00
sanstats Internalize functions from various tools. NFC 2020-09-26 15:57:13 -07:00
split-file [split-file] Fix sys::fs::remove() on Solaris after D83834 2020-08-11 08:05:10 -07:00
verify-uselistorder
vfabi-demangle-fuzzer [llvm][VectorUtils] Tweak VFShape for scalable vector functions. 2020-01-30 05:53:56 +00:00
xcode-toolchain
yaml2obj [yaml2obj] - Add a way to set default values for macros used in a YAML. 2020-06-30 12:05:30 +03:00
CMakeLists.txt [Flang] add flang as a new subproject in cmake 2020-04-09 16:13:18 +01:00
LLVMBuild.txt Revert "[IRSim] Adding basic implementation of llvm-sim." 2020-09-25 16:18:48 -05:00