[SPIRV] support builtin functions
authorIlia Diachkov <ilia.diachkov@gmail.com>
Tue, 23 Aug 2022 23:13:19 +0000 (02:13 +0300)
committerIlia Diachkov <ilia.diachkov@gmail.com>
Wed, 24 Aug 2022 21:30:33 +0000 (00:30 +0300)
commitf61eb416238fd581c3823a0d372febaed4e27f26
tree755c76fd3a96f94539cb48c481e74577a6b7a8fa
parent611399806923e3e76a04e16bebb1fa7b85354346
[SPIRV] support builtin functions

The patch adds support for OpenCL and SPIR-V built-in functions.
Their detection and properties are implemented using TableGen.
Five tests are added to demonstrate the improvement.

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

Co-authored-by: Aleksandr Bezzubikov <zuban32s@gmail.com>
Co-authored-by: Michal Paszkowski <michal.paszkowski@outlook.com>
Co-authored-by: Andrey Tretyakov <andrey1.tretyakov@intel.com>
Co-authored-by: Konrad Trifunovic <konrad.trifunovic@intel.com>
28 files changed:
llvm/lib/Target/SPIRV/CMakeLists.txt
llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.cpp
llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVBaseInfo.h
llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.cpp
llvm/lib/Target/SPIRV/MCTargetDesc/SPIRVInstPrinter.h
llvm/lib/Target/SPIRV/SPIRV.td
llvm/lib/Target/SPIRV/SPIRVAsmPrinter.cpp
llvm/lib/Target/SPIRV/SPIRVBuiltins.cpp [new file with mode: 0644]
llvm/lib/Target/SPIRV/SPIRVBuiltins.h [new file with mode: 0644]
llvm/lib/Target/SPIRV/SPIRVBuiltins.td [new file with mode: 0644]
llvm/lib/Target/SPIRV/SPIRVCallLowering.cpp
llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.cpp
llvm/lib/Target/SPIRV/SPIRVDuplicatesTracker.h
llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.cpp
llvm/lib/Target/SPIRV/SPIRVGlobalRegistry.h
llvm/lib/Target/SPIRV/SPIRVInstrInfo.td
llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
llvm/lib/Target/SPIRV/SPIRVModuleAnalysis.cpp
llvm/lib/Target/SPIRV/SPIRVPreLegalizer.cpp
llvm/lib/Target/SPIRV/SPIRVSubtarget.cpp
llvm/lib/Target/SPIRV/SPIRVSubtarget.h
llvm/lib/Target/SPIRV/SPIRVUtils.cpp
llvm/lib/Target/SPIRV/SPIRVUtils.h
llvm/test/CodeGen/SPIRV/builtin_vars-decorate.ll [new file with mode: 0644]
llvm/test/CodeGen/SPIRV/capability-Int64Atomics.ll [new file with mode: 0644]
llvm/test/CodeGen/SPIRV/empty-module.ll [new file with mode: 0644]
llvm/test/CodeGen/SPIRV/spirv-tools-dis.ll [new file with mode: 0644]
llvm/test/CodeGen/SPIRV/transcoding/builtin_calls.ll [new file with mode: 0644]