summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)AuthorFilesLines
2018-05-14Allow to build LLVMSPIRV lib as static libraryAlexey Sotkin1-0/+6
2018-05-03Rename the installed header and install it in a prefixPierre Moreau1-1/+1
Also, the version was bumped to 0.2.1 (from 0.2.0) due to the changes. Fix: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/15
2018-04-24Rename all variables and functions to match LLVM guidelinesPierre Moreau1-10/+10
The project version was also changed as the entrypoints to the library have been modified. Command used: /usr/share/clang/run-clang-tidy.py -header-filter "(./include/SPIRV.h|./lib/SPIRV/Mangler/FunctionDescriptor.h|./lib/SPIRV/Mangler/ManglingUtils.h|./lib/SPIRV/Mangler/NameMangleAPI.h|./lib/SPIRV/Mangler/ParameterType.h|./lib/SPIRV/Mangler/Refcount.h|./lib/SPIRV/libSPIRV/libSPIRV.h|./lib/SPIRV/libSPIRV/SPIRVBasicBlock.h|./lib/SPIRV/libSPIRV/SPIRVDebug.h|./lib/SPIRV/libSPIRV/SPIRVDecorate.h|./lib/SPIRV/libSPIRV/SPIRVEntry.h|./lib/SPIRV/libSPIRV/SPIRVEnum.h|./lib/SPIRV/libSPIRV/SPIRVError.h|./lib/SPIRV/libSPIRV/SPIRVErrorEnum.h|./lib/SPIRV/libSPIRV/SPIRVExtInst.h|./lib/SPIRV/libSPIRV/SPIRVFunction.h|./lib/SPIRV/libSPIRV/SPIRVInstruction.h|./lib/SPIRV/libSPIRV/SPIRVIsValidEnum.h|./lib/SPIRV/libSPIRV/SPIRVModule.h|./lib/SPIRV/libSPIRV/SPIRVNameMapEnum.h|./lib/SPIRV/libSPIRV/SPIRVOpCode.h|./lib/SPIRV/libSPIRV/SPIRVOpCodeEnum.h|./lib/SPIRV/libSPIRV/SPIRVStream.h|./lib/SPIRV/libSPIRV/SPIRVType.h|./lib/SPIRV/libSPIRV/SPIRVUtil.h|./lib/SPIRV/libSPIRV/SPIRVValue.h|./lib/SPIRV/runtime/OpenCL/inc/spirv.h|./lib/SPIRV/runtime/OpenCL/inc/spirv_convert.h|./lib/SPIRV/OCLUtil.h|./lib/SPIRV/OCLTypeToSPIRV.h|./lib/SPIRV/SPIRVInternal.h|./lib/SPIRV/SPIRVMDBuilder.h|./lib/SPIRV/SPIRVMDWalker.h|./lib/SPIRV/SPIRVWriterPass.h)" -checks="-*,readability-identifier-naming" `find . -iname "*.cpp"` Manual edits: * lib/SPIRV/Mangler/FunctionDescriptor.cpp * lib/SPIRV/libSPIRV/SPIRVEntry.h * lib/SPIRV/libSPIRV/SPIRVDecorate.h * lib/SPIRV/libSPIRV/SPIRVValue.h * lib/SPIRV/libSPIRV/SPIRVStream.h * lib/SPIRV/libSPIRV/SPIRVInstruction.h * lib/SPIRV/Mangler/ParameterType.cpp * lib/SPIRV/Mangler/Mangler.cpp * lib/SPIRV/OCL20ToSPIRV.cpp * lib/SPIRV/Mangler/ParameterType.h * lib/SPIRV/SPIRVLowerOCLBlocks.cpp * lib/SPIRV/SPIRVUtil.cpp * lib/SPIRV/Mangler/Refcount.h
2018-04-24Reformat all .cpp and .h files using clang-formatPierre Moreau1-39/+34
Commands run: * clang-format -i `find . -iname "*.cpp"` * clang-format -i `find . -iname "*.h"` Files manually reverted: * lib/SPIRV/libSPIRV/OpenCL.std.h * lib/SPIRV/runtime/OpenCL/inc/spirv.h * lib/SPIRV/runtime/OpenCL/inc/spirv_convert.h Files manually edited (to fix their first line): * lib/SPIRV/OCL20ToSPIRV.cpp * lib/SPIRV/OCL21ToSPIRV.cpp * lib/SPIRV/SPIRVInternal.h * lib/SPIRV/SPIRVLowerBool.cpp * lib/SPIRV/SPIRVLowerMemmove.cpp * lib/SPIRV/SPIRVToOCL20.cpp * lib/SPIRV/libSPIRV/SPIRVBasicBlock.cpp * lib/SPIRV/libSPIRV/SPIRVBasicBlock.h * lib/SPIRV/libSPIRV/SPIRVDebug.cpp * lib/SPIRV/libSPIRV/SPIRVDebug.h * lib/SPIRV/libSPIRV/SPIRVDecorate.cpp * lib/SPIRV/libSPIRV/SPIRVDecorate.h * lib/SPIRV/libSPIRV/SPIRVEntry.cpp * lib/SPIRV/libSPIRV/SPIRVEntry.h * lib/SPIRV/libSPIRV/SPIRVError.h * lib/SPIRV/libSPIRV/SPIRVExtInst.h (also added missing include to SPIRVEnum.h) * lib/SPIRV/libSPIRV/SPIRVFunction.cpp * lib/SPIRV/libSPIRV/SPIRVFunction.h * lib/SPIRV/libSPIRV/SPIRVInstruction.cpp * lib/SPIRV/libSPIRV/SPIRVInstruction.h * lib/SPIRV/libSPIRV/SPIRVModule.cpp * lib/SPIRV/libSPIRV/SPIRVModule.h * lib/SPIRV/libSPIRV/SPIRVStream.cpp * lib/SPIRV/libSPIRV/SPIRVStream.h * lib/SPIRV/libSPIRV/SPIRVType.cpp * lib/SPIRV/libSPIRV/SPIRVUtil.h * lib/SPIRV/libSPIRV/SPIRVValue.cpp * lib/SPIRV/libSPIRV/SPIRVValue.h
2018-04-24Change all line endings to UNIX-stylePierre Moreau3-340/+340
The code was currently using a mix of DOS-style and UNIX-style; LLVM itself uses UNIX-style. Commands used: * dos2unix `find include -iname "*"` * dos2unix `find lib -iname "*"` * dos2unix `find test -iname "*"` * dos2unix `find tools -iname "*"`
2018-04-16cmake: rework to be able to build outside LLVMKarol Herbst1-15/+15
v2: convert to lower case
2018-04-03Upgrade SPIRV translator from LLVM 4.0 to the curent SVN revision 327279Alexey Sotkin1-49/+25
Change-Id: I10dc4476c2851a54434a47406fff0840da0b9951
2018-04-03Upgrade SPIRV translator from LLVM 3.6 to LLVM 3.8Alexey Sotkin1-6/+6
Change-Id: I97247b6472ff75ea83e12a485e06809ad2d2061c
2018-04-03Reorganizing the SPIR-V/LLVM Translator treeAlexey Sotkin1-3/+4
Before this commit the SPIR-V/LLVM Translator was part of the LLVM tree. The history has been rewritten before this commit, so everything not related to SPIR-V was removed with git filter-branch. Some directories were moved around to be in accordance with http://llvm.org/docs/Projects.html#source-tree-layout Also adding CMakeLists.txt and LIT config files.
2016-03-30[SPIR-V] Null-pointer checks.Alexey Bader1-0/+2
Add asserts for potential nullprt-s.
2016-03-25[SPIR-V] Minor refactoring.Alexey Bader1-1/+1
- Delete OpenCLVer parameter of oclIsBuiltin function. This parameter was used to detect CPP kernel language and was later replaced by isCPP parameter. - Fixed detection of OpenCL 2.0+ in OCL20To12 module pass. - Fixed warnings about defining unused variables and extra semicolon.
2016-03-13gen_spirv: Output a complete header file, not just the contentPierre Moreau1-4/+66
The produced file contains a header, proper include guards, includes to necessary headers and put the code within the `SPIRV` namespace.
2016-03-13gen_spirv: Generate `isValid*Mask()` functionsPierre Moreau1-2/+26
2016-03-13gen_spirv: Inline generated `isValid()` functionsPierre Moreau1-2/+1
2016-03-13gen_spirv: Remove left-over commentsPierre Moreau1-3/+0
2016-03-13gen_spirv: Check for non-small letter after prefixPierre Moreau1-3/+3
Previously, searching for `ExecutionMode` would match against `ExecutionModel` as well, which is not the desired behaviour.
2016-02-23Merge pull request #69 from KhronosGroup/add-gen-spirv-scriptbader1-0/+124
Add gen_spirv.bash script for generating code from spirv.h
2016-02-23Add gen_spirv.bash script for generating code from spirv.hYaxun (Sam) Liu1-0/+124
2016-02-20Use ".spt" default file extension for output file if '-spirv-text' option is ↵Alexey Bader1-1/+7
set.
2015-12-14Clang integration.Alexey Bader1-7/+8
- Added SPIRVWriterPass. - Switched from std::ostream to llvm::raw_ostream.
2015-11-13[SPIRV] Fix translation of group pipe functions. work_ and sub_ prefix are ↵Yaxun (Sam) Liu1-3/+3
not in the translated builtin function name. Fix generator enum name. Fix mem leak when mangling opaque type names. Should not use new in StringSwitch Case since it is always executed even the case fails. Bump up version to 2.
2015-11-02[SPIRV] Add processing SPIR-V metadata.Yaxun (Sam) Liu1-2/+4
Add translation of SPIR 1.2/2.0 metadata to SPIR-V metadata Fix OpExtension/OpSourceExtension to have one extension string instead of spaced separated multiple extension strings in each instruction. Fix OpExecutionMode for ExecutionModeVectorTypeHint to use encoding instead of type id/string. Fix bug about reading empty string in text format SPIR-V. Allow llvm_spirv to use -o - for output to stdout. Fix OpEntryPoint to add name of entry pointer function.
2015-10-29[SPIRV] Allow functions for extended instructions to have postfixes for ↵Yaxun (Sam) Liu1-2/+8
decoration. Add prefix for return type for vload/vloada since function type can differ by only return type. Set ouputing stack trace on error.
2015-10-23[SPIRV] Rename SPRV to SPIRV for clarityYaxun (Sam) Liu1-18/+18
2015-09-14[SPIRV] Added mem2reg pass to regularize unoptimized LLVM IR.Alexey Bader1-0/+1
llvm-spirv tool is supposed to be run with an unoptimized output of clang, which contains a lot of constructions like: %a.addr = alloca i32 addrspace(1)*, align 4 store i32 addrspace(1)* %a, i32 addrspace(1)** %a.addr, align 4 %0 = load i32 addrspace(1)** %a.addr, align 4 Which must be removed for correct translation to SPiR-V. TODO: probably we will need to add SROA to regularization passes in order to handle aggregate data types.
2015-09-08[SPIRV]Fix bug causing verify module error msg not output.samliu1-1/+1
Fix bug about OpMemoryBarrier word count. Fix build failure on Ubuntu due to class member named as Op. Refactoring translation of atomic builtin functions.
2015-09-03[SPIRV] Fix asserts due to ReplaceAllReferencesWith dst/src type mismatch in ↵samliu1-0/+11
SPIR loader when lowering islessgreater for double16 type args.
2015-08-24[SPIRV] Fix bug about decoration group, string literal, and loading SPIR-V.Yaxun (Sam) Liu1-10/+73
2015-06-01Clean up and restructure. Added partial support of kernel enqueue. Conforms ↵Yaxun (Sam) Liu3-43/+41
to spirv r30819.
2015-05-26[SPIRV] Removed LLVM 3.4 support from SPIRV.Alexey Bader1-53/+0
Now it's part of llvm release branch.
2015-05-26[SPIRV] SPIR-V library and llvm-spirv converter toolAlexey Bader4-0/+341
Added SPIR-V library with reader/writer from/to LLVM IR with spir name mangler library from https://github.com/KhronosGroup/SPIR-Tools/tree/master/spir-tools/spir_name_mangler rev. bebbc22f5125fde2243bfa4eedb615f663a96172.