Commit 0045d01a authored by Anastasia Stulova's avatar Anastasia Stulova
Browse files

[SPIR-V] Add a toolchain for SPIR-V in clang

This patch adds a toolchain (TC) for SPIR-V along with the
following changes in Driver and base ToolChain and Tool.
This is required to provide a mechanism in clang to bypass
SPIR-V backend in LLVM for SPIR-V until it lands in LLVM and
matures.

The SPIR-V code is generated by the SPIRV-LLVM translator tool
named 'llvm-spirv' that is sought in 'PATH'.

The compilation phases/actions should be bound for SPIR-V in
the meantime as following:

    compile -> tools::Clang
    backend -> tools::SPIRV::Translator
    assemble -> tools::SPIRV::Translator

However, Driver’s ToolSelector collapses compile-backend-assemble
and compile-backend sequences to tools::Clang. To prevent this,
added new {use,has}IntegratedBackend properties in ToolChain and
Tool to which the ToolSelector reacts on, and which SPIR-V TC
overrides.

Linking of multiple input files is currently not supported but
can be added separately.

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



Co-authored-by: default avatarHenry Linjamäki <henry.linjamaki@parmance.com>
parent 71fc4bbd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment