| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original commit failed to handle "shift assign" (<<=), which
broke the test mentioned in r228406. This is now fixed and the
test added to the lit tests under SemaOpenCL.
*** Original commit message from r228382 ***
OpenCL: handle shift operator with vector operands
Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.
Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".
char2 foo(char2 v) { return v << 1; }
Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.
llvm-svn: 230464
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit r228382.
This breaks the following case: Reported by Jeroen Ketema:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150202/122961.html
typedef __attribute__((ext_vector_type(3))) char char3;
void foo() {
char3 v = {1,1,1};
char3 w = {1,2,3};
w <<= v;
}
If I compile with:
clang -x cl file.c
Then an error is produced:
file.c:10:5: error: expression is not assignable
w <<= v;
~ ^
1 error generated.
llvm-svn: 228406
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.
Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".
char2 foo(char2 v) { return v << 1; }
Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.
llvm-svn: 228382
|
| |
|
|
|
|
|
|
|
|
| |
When the condition is a vector, OpenCL specifies additional
requirements on the operand types, and also the operations
required to determine the result type of the operator. This is a
combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics
remain unchanged in later versions of OpenCL.
llvm-svn: 228118
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In OpenCL 1.2, using double no longer requires using the pragma cl_khr_fp64,
instead a kernel is allowed to use double, but must first have queried
clGetDeviceInfo's CL_DEVICE_DOUBLE_FP_CONFIG.
Page 197, section 6.1.1 of the OpenCL 1.2 specification has a footnote 23
describing this behaviour.
I've also added test cases such that the pragma must be used if targeting
OpenCL 1.0 or 1.1, but is ignored in 1.2 and 2.0.
Patch by Neil Henning!
Reviewers: Pekka Jääskeläinen
Differential Revision: http://reviews.llvm.org/D7245
llvm-svn: 227565
|
| |
|
|
|
|
|
|
|
|
|
| |
Placing the attribute after the kernel keyword would incorrectly
reject the attribute, so use the smae workaround that other
kernel only attributes use.
Also add a FIXME because there are two different phrasings now
for the same error, althoug amdgpu_num_[sv]gpr uses a consistent one.
llvm-svn: 223490
|
| |
|
|
|
|
|
| |
This is a performance hint that can be applied to kernels
to attempt to limit the number of used registers.
llvm-svn: 223384
|
| |
|
|
|
|
|
|
|
|
|
|
| |
OpenCL v2.0.
OpenCL v2.0 s6.5.5 restricts conversion of pointers to different address spaces:
- the named address spaces (__global, __local, and __private) => __generic - implicitly converted;
- __generic => named - with an explicit cast;
- named <=> named - disallowed;
- __constant <=> any other - disallowed.
llvm-svn: 222834
|
| |
|
|
| |
llvm-svn: 219929
|
| |
|
|
|
|
| |
The ensures there is an explicit address space id in the output.
llvm-svn: 219928
|
| |
|
|
|
|
| |
Patch by Pedro Ferreira!
llvm-svn: 209127
|
| |
|
|
| |
llvm-svn: 208499
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We never aka vector types because our attributed syntax for it is less
comprehensible than the typedefs. This leaves the user in the dark when
the typedef isn't named that well.
Example:
v2s v; v4f w;
w = v;
The naming in this cases isn't even that bad, but the error we give is
useless without looking up the actual typedefs.
t.c:6:5: error: assigning to 'v4f' from incompatible type 'v2s'
Now:
t.c:6:5: error: assigning to 'v4f' (vector of 4 'float' values) from
incompatible type 'v2s' (vector of 2 'int' values)
We do this for all diagnostics that print a vector type.
llvm-svn: 207267
|
| |
|
|
|
|
|
| |
There are now only a handful of Sema tests remaining that use %clang in
SemaCXX, SemaObjC and SemaTemplate.
llvm-svn: 206688
|
| |
|
|
| |
llvm-svn: 206275
|
| |
|
|
|
|
|
|
|
| |
cannot be a pointer to the private address space (as clarified
in the OpenCL 1.2 specification).
Patch by Fraser Cormack!
llvm-svn: 204941
|
| |
|
|
|
|
| |
Patch from Anastasia Stulova!
llvm-svn: 201788
|
| |
|
|
|
|
|
|
| |
The tests (forgot to svn add, sorry!).
Patch from Fraser Cormack!
llvm-svn: 199907
|
| |
|
|
|
|
| |
parameter because the required information is encoded in the spelling. Added an appropriate subject to the attribute, and simplified the semantic checking (which will likely be expanded upon in a future patch). Also, removed the GNU spelling since it was unsupported in the first place.
llvm-svn: 199229
|
| |
|
|
| |
llvm-svn: 199208
|
| |
|
|
|
|
| |
type of a function.
llvm-svn: 198597
|
| |
|
|
| |
llvm-svn: 198422
|
| |
|
|
| |
llvm-svn: 198417
|
| |
|
|
| |
llvm-svn: 198300
|
| |
|
|
|
|
| |
Patch by joey.gouly@arm.com
llvm-svn: 198264
|
| |
|
|
|
|
|
|
| |
are used on non-kernel functions.
Reviewed by Aaron over IRC!
llvm-svn: 197243
|
| |
|
|
| |
llvm-svn: 194717
|
| |
|
|
| |
llvm-svn: 194068
|
| |
|
|
|
|
| |
functionality was never completely implemented, and this is an improvement over silently eating the attribute.
llvm-svn: 190303
|
| |
|
|
|
|
|
|
|
|
| |
vector types,
so allow that case and add appropriate tests.
Patch by Ruiling Song!
llvm-svn: 190129
|
| |
|
|
|
|
| |
argument list.
llvm-svn: 189711
|
| |
|
|
|
|
|
|
| |
diagnostic for clarity; updated almost all of the affected test cases.
Thanks to Fariborz Jahanian for the suggestion!
llvm-svn: 186980
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
| |
address space in OpenCL.
llvm-svn: 178906
|
| |
|
|
| |
llvm-svn: 178813
|
| |
|
|
|
|
| |
address space in OpenCL.
llvm-svn: 178811
|
| |
|
|
| |
llvm-svn: 177035
|
| |
|
|
|
|
| |
r176686. I missed this file in the previous commit.
llvm-svn: 176803
|
| |
|
|
| |
llvm-svn: 175736
|
| |
|
|
| |
llvm-svn: 175734
|
| |
|
|
|
|
| |
Patch by Joey Gouly!
llvm-svn: 174928
|
| |
|
|
|
|
| |
OpenCL builtin functions.
llvm-svn: 174630
|
| |
|
|
|
|
| |
restrictions.
llvm-svn: 174601
|
| |
|
|
|
|
| |
a test case.
llvm-svn: 173963
|
| |
|
|
| |
llvm-svn: 173802
|
| |
|
|
|
|
| |
Also refactor the surrounding code a little.
llvm-svn: 173791
|
| |
|
|
|
|
|
| |
Program scope variables must be declared in the constant address space
and are required to be initialized.
llvm-svn: 173354
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
| |
operations (as opposed to storage only half/fp16).
Also add some semantic checks for OpenCL half types.
llvm-svn: 173254
|
| |
|
|
|
|
| |
OpenCL restrictions (OpenCL 1.2 spec 6.9)
llvm-svn: 172973
|