diff options
author | Farzon Lotfi <farzonlotfi@microsoft.com> | 2025-01-06 11:37:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-06 11:37:20 -0500 |
commit | 21edac25f09faee23015c6a69d95fcbda287efe2 (patch) | |
tree | 94f291efe78f308c189981c0695de48bc58c5d5a /clang/lib/Sema/Sema.cpp | |
parent | ca603d2536f039194141bf3a01e9ee7f60e37406 (diff) | |
download | llvm-21edac25f09faee23015c6a69d95fcbda287efe2.zip llvm-21edac25f09faee23015c6a69d95fcbda287efe2.tar.gz llvm-21edac25f09faee23015c6a69d95fcbda287efe2.tar.bz2 |
[SPIRV] Add Target Builtins using Distance ext as an example (#121598)
- Update pr labeler so new SPIRV files get properly labeled.
- Add distance target builtin to BuiltinsSPIRV.td.
- Update TargetBuiltins.h to account for spirv builtins.
- Update clang basic CMakeLists.txt to build spirv builtin tablegen.
- Hook up sema for SPIRV in Sema.h|cpp, SemaSPIRV.h|cpp, and
SemaChecking.cpp.
- Hookup sprv target builtins to SPIR.h|SPIR.cpp target.
- Update GBuiltin.cpp to emit spirv intrinsics when we get the expected
spirv target builtin.
Consensus was reach in this RFC to add both target builtins and pattern
matching:
https://discourse.llvm.org/t/rfc-add-targetbuiltins-for-spirv-to-support-hlsl/83329.
pattern matching will come in a separate pr this one just sets up the
groundwork to do target builtins for spirv.
partially resolves
[#99107](https://github.com/llvm/llvm-project/issues/99107)
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index d651751..abb46d3 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -61,6 +61,7 @@ #include "clang/Sema/SemaPPC.h" #include "clang/Sema/SemaPseudoObject.h" #include "clang/Sema/SemaRISCV.h" +#include "clang/Sema/SemaSPIRV.h" #include "clang/Sema/SemaSYCL.h" #include "clang/Sema/SemaSwift.h" #include "clang/Sema/SemaSystemZ.h" @@ -239,6 +240,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer, PPCPtr(std::make_unique<SemaPPC>(*this)), PseudoObjectPtr(std::make_unique<SemaPseudoObject>(*this)), RISCVPtr(std::make_unique<SemaRISCV>(*this)), + SPIRVPtr(std::make_unique<SemaSPIRV>(*this)), SYCLPtr(std::make_unique<SemaSYCL>(*this)), SwiftPtr(std::make_unique<SemaSwift>(*this)), SystemZPtr(std::make_unique<SemaSystemZ>(*this)), |