summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Add atomic builtin functionsSven van Haastregt2019-12-231-2/+8
| | | | | | Add atomic builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt.
* [OpenCL] Add builtin function extension handlingSven van Haastregt2019-12-181-4/+19
| | | | | | | | | | 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] Add work-group and miscellaneous vector builtin functionsSven van Haastregt2019-11-261-0/+8
| | | | | | | Add the work-group and miscellaneous vector builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt.
* [OpenCL] Add integer builtin functionsSven van Haastregt2019-11-071-5/+8
| | | | | | | | | This patch adds the integer builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D69901
* [OpenCL] Support -fdeclare-opencl-builtins in C++ modeSven van Haastregt2019-11-011-3/+5
| | | | | | | Support for C++ mode was accidentally lacking due to not checking the OpenCLCPlusPlus LangOpts version. Differential Revision: https://reviews.llvm.org/D69233
* [OpenCL] Add -Wconversion to fdeclare-opencl-builtins testSven van Haastregt2019-09-261-6/+7
| | | | | | | | | | | Add the -Wconversion -Werror options to check no unexpected conversion is done. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D67714 llvm-svn: 372975
* [OpenCL] Add image query builtin functionsSven van Haastregt2019-09-251-0/+4
| | | | | | | | | | Add the image query builtin functions from the OpenCL C specification. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D67713 llvm-svn: 372833
* [OpenCL] Add version handling and add vector ld/st builtinsSven van Haastregt2019-09-191-0/+50
| | | | | | | | | | | | | | | | | | | 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-0/+30
| | | | | | | | | | | | | | | | | | | 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] Add const, volatile and pointer builtin handlingSven van Haastregt2019-08-201-0/+10
| | | | | | | | | | | | | | 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-8/+21
| | | | | | | | | | | | | | | | | | 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] Split type and macro definitions into opencl-c-base.hSven van Haastregt2019-06-191-1/+5
| | | | | | | | | | | | | | | | Using the -fdeclare-opencl-builtins option will require a way to predefine types and macros such as `int4`, `CLK_GLOBAL_MEM_FENCE`, etc. Move these out of opencl-c.h into opencl-c-base.h such that the latter can be shared by -fdeclare-opencl-builtins and -finclude-default-header. This changes the behaviour of -finclude-default-header when -fdeclare-opencl-builtins is specified: instead of including the full header, it will include the header with only the base definitions. Differential revision: https://reviews.llvm.org/D63256 llvm-svn: 363794
* [OpenCL] Declare builtin functions using TableGenSven van Haastregt2019-06-031-0/+24
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