diff options
author | Pierre Moreau <dev@pmoreau.org> | 2017-07-13 03:16:51 +0300 |
---|---|---|
committer | David Neto <dneto@google.com> | 2017-10-07 01:33:53 +0300 |
commit | 86627f7b3f725d390b6e09078db0f41f10c9d165 (patch) | |
tree | c23fb62e45ebdef060e07eac66cc862fe343d89f /README.md | |
parent | 4b1577a0cbcfdbdbbe540b7ba91945b70ac7fb46 (diff) |
Implement Linker (module combiner)
Add extra iterators for ir::Module's sections
Add extra getters to ir::Function
Add a const version of BasicBlock::GetLabelInst()
Use the max of all inputs' version as version
Split debug in debug1 and debug2
- Debug1 instructions have to be placed before debug2 instructions.
Error out if different addressing or memory models are found
Exit early if no binaries were given
Error out if entry points are redeclared
Implement copy ctors for Function and BasicBlock
- Visual Studio ends up generating copy constructors that call deleted
functions while compiling the linker code, while GCC and clang do not.
So explicitly write those functions to avoid Visual Studio messing up.
Move removing duplicate capabilities to its own pass
Add functions running on all IDs present in an instruction
Remove duplicate SpvOpExtInstImport
Give default options value for link functions
Remove linkage capability if not making a library
Check types before allowing to link
Detect if two types/variables/functions have different decorations
Remove decorations of imported variables/functions and their types
Add a DecorationManager
Add a method for removing all decorations of id
Add methods for removing operands from instructions
Error out if one of the modules has a non-zero schema
Update README.md to talk about the linker
Do not freak out if an imported built-in variable has no export
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 41 |
1 files changed, 39 insertions, 2 deletions
@@ -109,12 +109,28 @@ Currently supported optimizations: * Eliminate dead branches * Merge single successor / single predecessor block pairs * Eliminate common uniform loads + * Remove duplicates: Capabilities, extended instruction imports, types, and + decorations. For the latest list with detailed documentation, please refer to [`include/spirv-tools/optimizer.hpp`](include/spirv-tools/optimizer.hpp). For suggestions on using the code reduction options, please refer to this [white paper](https://www.lunarg.com/shader-compiler-technologies/white-paper-spirv-opt/). + +### Linker + +*Note:* The linker is still under development. + +Current features: +* Combine multiple SPIR-V binary modules together. +* Combine into a library (exports are retained) or an executable (no symbols + are exported). + +See the [CHANGES](CHANGES) file for reports on completed work, and the [General +sub-project](https://github.com/KhronosGroup/SPIRV-Tools/projects/2) for +planned and in-progress work. + ### Extras * [Utility filters](#utility-filters) @@ -255,10 +271,11 @@ There are five main entry points into the library in the C interface: * `spvValidate` implements the validator functionality. *Incomplete* * `spvValidateBinary` implements the validator functionality. *Incomplete* -The C++ interface is comprised of two classes, `SpirvTools` and `Optimizer`, -both in the `spvtools` namespace. +The C++ interface is comprised of three classes, `SpirvTools`, `Optimizer` and +`Linker`, all in the `spvtools` namespace. * `SpirvTools` provides `Assemble`, `Disassemble`, and `Validate` methods. * `Optimizer` provides methods for registering and running optimization passes. +* `Linker` provides methods for combining together multiple binaries. ## Command line tools @@ -295,6 +312,18 @@ Use option `-h` to print help. The output includes syntax colouring when printing to the standard output stream, on Linux, Windows, and OS X. +### Linker tool + +The linker combines multiple SPIR-V binary modules together, resulting in a single +binary module as output. + +This is a work in progress. +The linker does not support OpenCL program linking options related to math +flags. (See section 5.6.5.2 in OpenCL 1.2) + +* `spirv-link` - the standalone linker + * `<spirv-dir>/tools/link` + ### Optimizer tool The optimizer processes a SPIR-V binary module, applying transformations @@ -395,6 +424,14 @@ for more information._ This is a work in progress. +### Linker + +* The linker could accept math transformations such as allowing MADs, or other + math flags passed at linking-time in OpenCL. +* Linkage attributes can not be applied through a group. +* Check decorations of linked functions attributes. +* Remove dead instructions, such as OpName targeting imported symbols. + ## Licence <a name="license"></a> Full license terms are in [LICENSE](LICENSE) |