summaryrefslogtreecommitdiffstats
path: root/clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang][OpenCL] Fix covered switch warningJinsong Ji2020-01-141-3/+1
| | | | | | | | | | | | | | | -Werror clang build is broken now. tools/clang/lib/Sema/OpenCLBuiltins.inc:11824:5: error: default label in switch which covers all enumeration values [-Werror,-Wcovered-switch-default] default: We don't need default now, since all enumeration values are covered. Reviewed By: svenvh Differential Revision: https://reviews.llvm.org/D72707
* [OpenCL] Add builtin function extension handlingSven van Haastregt2019-12-181-7/+43
| | | | | | | | | | Provide a mechanism to attach OpenCL extension information to builtin functions, so that their use can be restricted according to the extension(s) the builtin is part of. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D71476
* [OpenCL] Group builtin functions by prototypeSven van Haastregt2019-11-051-13/+136
| | | | | | | | | | The TableGen-generated file containing the function definitions can be reorganized to save some memory in the Clang binary. Functions having the same prototype(s) will point to a shared list of prototype(s). Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63557
* [OpenCL] Add builtin function attribute handlingSven van Haastregt2019-11-051-0/+9
| | | | | | | | | Add handling for the "pure", "const" and "convergent" function attributes for OpenCL builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D64319
* Use scope qualifiers in Clang's tblgen backends to get usefulJohn McCall2019-10-011-5/+2
| | | | | | redeclaration checking. NFC. llvm-svn: 373406
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-191-7/+15
| | | | | | | | | | | | | | | | | | | Allow setting a MinVersion, stating from which OpenCL version a builtin function is available, and a MaxVersion, stating from which OpenCL version a builtin function should not be available anymore. Guard some definitions of the "work-item" builtin functions according to the OpenCL versions from which they are available. Add the "vector data load and store" builtin functions (e.g. vload/vstore), whose signatures differ before and after OpenCL 2.0 in the pointer argument address spaces. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63504 llvm-svn: 372321
* [OpenCL] Add image type handling for builtinsSven van Haastregt2019-09-051-3/+67
| | | | | | | | | | | | | | | | | | | Image types were previously available, but not working. This patch adds image type handling. Rename the image type definitions in the .td file to make them consistent with other type names. Use abstract types to represent the unqualified types. Instantiate access-qualified image types at the point of use using, e.g. `ImageType<Image2d, "RO">`. Add/update TableGen definitions for the read_image/write_image builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63480 llvm-svn: 371046
* [OpenCL] Drop spurious semicolon in generated file; NFCSven van Haastregt2019-09-031-1/+1
| | | | llvm-svn: 370744
* [OpenCL] Microoptimize OCL2Qual a bitBenjamin Kramer2019-08-241-9/+11
| | | | | | Still not optimal, but makes clang 25k smaller. llvm-svn: 369846
* [OpenCL] Add const, volatile and pointer builtin handlingSven van Haastregt2019-08-201-2/+36
| | | | | | | | | | | | | | Const, volatile, and pointer types were previously available, but not working. This patch adds handling for OpenCL builtin functions. Add TableGen definitions for some atomic and asynchronous builtins to make use of the new functionality. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D63442 llvm-svn: 369373
* [OpenCL] Add generic type handling for builtin functionsSven van Haastregt2019-08-191-103/+326
| | | | | | | | | | | | | | | | | | Generic types are an abstraction of type sets. It mimics the way functions are defined in the OpenCL specification. For example, floatN can abstract all the vector sizes of the float type. This allows to * stick more closely to the specification, which uses generic types; * factorize definitions of functions with numerous prototypes in the tablegen file; and * reduce the memory impact of functions with many overloads. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D65456 llvm-svn: 369253
* [OpenCL] Make TableGen'd builtin tables and helper functions staticTom Stellard2019-07-151-3/+3
| | | | | | | | | | | | | | Reviewers: Pierre, Anastasia Reviewed By: Anastasia Subscribers: yaxunl, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64608 llvm-svn: 366143
* [OpenCL] Declare builtin functions using TableGenSven van Haastregt2019-06-031-0/+318
This patch adds a `-fdeclare-opencl-builtins` command line option to the clang frontend. This enables clang to verify OpenCL C builtin function declarations using a fast StringMatcher lookup, instead of including the opencl-c.h file with the `-finclude-default-header` option. This avoids the large parse time penalty of the header file. This commit only adds the basic infrastructure and some of the OpenCL builtins. It does not cover all builtins defined by the various OpenCL specifications. As such, it is not a replacement for `-finclude-default-header` yet. RFC: http://lists.llvm.org/pipermail/cfe-dev/2018-November/060041.html Co-authored-by: Pierre Gondois Co-authored-by: Joey Gouly Co-authored-by: Sven van Haastregt Differential Revision: https://reviews.llvm.org/D60763 llvm-svn: 362371
OpenPOWER on IntegriCloud