Commit Graph

45 Commits

Author SHA1 Message Date
Joey Gouly 16cb99dd15 [OpenCL] Produce an error if an address space is used on the return
type of a function.

llvm-svn: 198597
2014-01-06 11:26:18 +00:00
Joey Gouly b6eb314c3a [OpenCL] Add test case for previous commit.
llvm-svn: 198422
2014-01-03 15:11:57 +00:00
Joey Gouly 96b94e610b [OpenCL] Variables in the constant address space must be initialized.
llvm-svn: 198417
2014-01-03 14:16:55 +00:00
Joey Gouly d4993032a9 [OpenCL] The kernel attribute can only be used on functions.
llvm-svn: 198300
2014-01-02 12:04:42 +00:00
Joey Gouly 4ba0f1e2d7 [OpenCL] Produce an error, instead of a warning, for sizeof(void) in OpenCL.
Patch by joey.gouly@arm.com

llvm-svn: 198264
2013-12-31 15:47:49 +00:00
Joey Gouly 2cd9db1cef [OpenCL] Produce an error when the work group and vec type hint attributes
are used on non-kernel functions.

Reviewed by Aaron over IRC!

llvm-svn: 197243
2013-12-13 16:15:28 +00:00
Joey Gouly 561bba2e9f [OpenCL] Make sure we put string literals in the constant address space.
llvm-svn: 194717
2013-11-14 18:26:10 +00:00
Joey Gouly a7310a8cfa Do not allow functions or kernels called 'main' in OpenCL.
llvm-svn: 194068
2013-11-05 12:30:39 +00:00
Aaron Ballman 60f62ad3d3 Removing the endian attribute and updating associated test cases. This functionality was never completely implemented, and this is an improvement over silently eating the attribute.
llvm-svn: 190303
2013-09-09 12:57:20 +00:00
David Tweed 16574d8e85 OpenCL allows the (pre/post)-(increment/decrement) operator on integer vector types,
so allow that case and add appropriate tests.

Patch by Ruiling Song!

llvm-svn: 190129
2013-09-06 09:58:08 +00:00
Aaron Ballman 00e99966c4 Consolidating the notion of a GNU attribute parameter with the attribute argument list.
llvm-svn: 189711
2013-08-31 01:11:41 +00:00
Aaron Ballman b7243381c2 Added the attribute name to the err_attribute_wrong_number_arguments diagnostic for clarity; updated almost all of the affected test cases.
Thanks to Fariborz Jahanian for the suggestion!

llvm-svn: 186980
2013-07-23 19:30:11 +00:00
Matt Arsenault efb38192b0 Error on more illegal kernel argument types for OpenCL
bool, half, pointers and structs / unions containing any
of these are not allowed. Does not yet reject size_t and
related integer types that are also disallowed.

llvm-svn: 186908
2013-07-23 01:23:36 +00:00
Tanya Lattner 713eef4f7c Add an error to check that all program scope variables are in the constant address space in OpenCL.
llvm-svn: 178906
2013-04-05 20:14:50 +00:00
Tanya Lattner 9a13c3e683 Revert 178811 until I fix the unit tests.
llvm-svn: 178813
2013-04-04 23:45:52 +00:00
Tanya Lattner 9812634c52 Add an error to check that all program scope variables are in the constant address space in OpenCL.
llvm-svn: 178811
2013-04-04 23:36:11 +00:00
Joey Gouly 0608ae89a2 Add support for the 'endian' attribute for OpenCL.
llvm-svn: 177035
2013-03-14 09:54:43 +00:00
Joey Gouly 4bd55d9356 Add a test case for the 'vec_type_hint' attribute that was introduced in
r176686. I missed this file in the previous commit.

llvm-svn: 176803
2013-03-11 12:38:45 +00:00
Joey Gouly c975cdcc58 Add a 64-bit triple to these tests, to fix 32-bit bots.
llvm-svn: 175736
2013-02-21 13:42:33 +00:00
Joey Gouly 7d00f00f1d Add support to Sema and CodeGen for floating point vector types in OpenCL.
llvm-svn: 175734
2013-02-21 11:49:56 +00:00
John McCall 6ced97aaae Diagnose loads of 'half' l-values in OpenCL.
Patch by Joey Gouly!

llvm-svn: 174928
2013-02-12 01:29:43 +00:00
Guy Benyei 259f9f4531 Enable overloading of OpenCL events - this is needed for the overloaded OpenCL builtin functions.
llvm-svn: 174630
2013-02-07 16:05:33 +00:00
Guy Benyei 610541989a Add OpenCL samplers as Clang builtin types and check sampler related restrictions.
llvm-svn: 174601
2013-02-07 10:55:47 +00:00
Tanya Lattner 0f86433efb Add OpenCL error that a kernel function must have void return type. Includes a test case.
llvm-svn: 173963
2013-01-30 19:48:52 +00:00
Joey Gouly 0942e0b5e1 Fix a crash in OpenCL code by using the proper (RHS) bit-width.
llvm-svn: 173802
2013-01-29 15:09:40 +00:00
Joey Gouly 39989dadd3 Add a diagnostic for an OpenCL kernel with a pointer pointer argument.
Also refactor the surrounding code a little.

llvm-svn: 173791
2013-01-29 10:54:06 +00:00
Joey Gouly 130a91e494 Fix a non-conformant OpenCL test case.
Program scope variables must be declared in the constant address space
and are required to be initialized.

llvm-svn: 173354
2013-01-24 15:24:54 +00:00
Joey Gouly f9283a51b8 Fix an OpenCL test case that was OpenCL conformant.
It had program scope variables that were not in the constant address space,
make them to be function scope variables instead.
Also move the test to the SemaOpenCL directory.

llvm-svn: 173352
2013-01-24 15:14:22 +00:00
Joey Gouly dd7f4566b1 Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.

llvm-svn: 173254
2013-01-23 11:56:20 +00:00
Guy Benyei 1b4fb3e08b Implement OpenCL event_t as Clang builtin type, including event_t related OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
2013-01-20 12:31:11 +00:00
Joey Gouly 1d58cdbf4e Add some semantic checks for OpenCL. Variadic macros, VLAs and bitfields are not supported.
llvm-svn: 172732
2013-01-17 17:35:00 +00:00
Andy Gibbs c6e68daac0 Prior to adding the new "expected-no-diagnostics" directive to VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive.
llvm-svn: 166280
2012-10-19 12:44:48 +00:00
Tanya Lattner 4bfc355094 Disable the warning for missing prototypes for OpenCL kernels. Includes testcase.
llvm-svn: 160766
2012-07-26 00:08:28 +00:00
Tanya Lattner 4fdce3faa8 Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature.
Added test case for 1.2 static storage class feature.

llvm-svn: 158759
2012-06-19 23:09:52 +00:00
Eli Friedman b9c7129012 Support constant evaluation for OpenCL nested vector literals. Patch by Anton Lokhmotov.
llvm-svn: 147496
2012-01-03 23:24:20 +00:00
Peter Collingbourne 5ad3ebaefd TypePrinter: print OpenCL address space names. Patch by Richard
Membarth, test case by myself.

llvm-svn: 144063
2011-11-08 02:52:58 +00:00
Tanya Lattner 49b3841398 The comparison of two vectors should return a signed result. hasIntegerRepresentation() used to always return false for vectors, but since it was changed, it also
changed the return type of a compare of two unsigned vectors to be unsigned. This patch removes the check for hasIntegerRepresentation since its not needed and returns the appropriate signed type.
I added a new test case and updated exisiting test cases that assumed an unsigned result.

llvm-svn: 142250
2011-10-17 21:00:38 +00:00
Tobias Grosser 766bcc27dc In OpenCL, conversions between different vector types are disallowed
OpenCL 6.2.1 says: "Implicit conversions between built-in vector data types are
disallowed."  OpenCL 6.2.2 says: "Explicit casts between vector types are not
legal."  For example:

uint4 u = (uint4)(1);
int4 i = u; // invalid implicit conversion
int4 e = (int4)u; // invalid explicit conversion

Fixes PR10967. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

llvm-svn: 140300
2011-09-22 13:03:14 +00:00
Tobias Grosser 0a3a22fe66 In the OpenCL mode, the AltiVec mode must be off and checks must be strict
OpenCL is different from AltiVec in the way it supports vector literals.  OpenCL
is strict with regards to semantic checks.  For example, implicit conversions
and explicit casts between vectors of different types are disallowed.

Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

llvm-svn: 140270
2011-09-21 18:28:29 +00:00
Peter Collingbourne 2dbb708b8a OpenCL: introduce support for function scope __local variables
llvm-svn: 140068
2011-09-19 21:14:35 +00:00
Tanya Lattner 8355938fcd This handles the missing cases of opencl vector literals.
Test cases provided by Anton Lokhmot.

llvm-svn: 135322
2011-07-15 23:07:01 +00:00
Peter Collingbourne c77f85b4b0 OpenCL: if double precision floating point constant encountered
without cl_khr_fp64, warn and cast to single precision

llvm-svn: 127476
2011-03-11 19:24:59 +00:00
Peter Collingbourne e190dee7a5 Add support for the OpenCL vec_step operator, by generalising and
extending the existing support for sizeof and alignof.  Original
patch by Guy Benyei.

llvm-svn: 127475
2011-03-11 19:24:49 +00:00
Peter Collingbourne e91b2dbdf1 OpenCL: standardise naming of test cases
llvm-svn: 125590
2011-02-15 19:46:41 +00:00
Peter Collingbourne e87167b7d8 OpenCL: semantic analysis support for cl_khr_fp64 extension
llvm-svn: 125588
2011-02-15 19:46:23 +00:00