David Tweed
31d09b0cef
Certain multi-platform languages, such as OpenCL, have the concept of
...
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.
Patch by Michele Scandale!
llvm-svn: 190684
2013-09-13 12:04:22 +00:00
Rafael Espindola
ff7cea8c1a
Don't pass -O0 to clang_cc1, it is the default.
...
llvm-svn: 189910
2013-09-04 04:12:25 +00:00
Stephen Lin
4362261b00
CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
...
llvm-svn: 188447
2013-08-15 06:47:53 +00:00
Justin Holewinski
368374308d
Use kernel metadata to differentiate between kernel and device
...
functions for the NVPTX target.
llvm-svn: 178418
2013-03-30 14:38:24 +00:00
Guy Benyei
fb36ede52e
Generate metadata to implement the -cl-kernel-arg-info option.
...
OpenCL 1.2 spec. 5.7.3.
llvm-svn: 177839
2013-03-24 13:58:12 +00:00
Guy Benyei
3832bfd557
Fix indirect byval passing of records in address spaced memory. Allocate memory on stack, and memcpy the actual value before the call.
...
llvm-svn: 176786
2013-03-10 12:59:00 +00:00
Joey Gouly
aba589cceb
Add support for the OpenCL attribute 'vec_type_hint'.
...
Patch by Murat Bolat!
llvm-svn: 176686
2013-03-08 09:42:32 +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
15eeddebdc
Fix an OpenCL test case. Pointer arguments to kernels must be declared with the
...
__global, __constant or __local qualifier.
llvm-svn: 175735
2013-02-21 12:06:32 +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
Tanya Lattner
60e93a6390
Use the target address space value when mangling names.
...
llvm-svn: 174688
2013-02-08 01:07:32 +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
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
David Tweed
c38f11de40
r172047 lacked a test (due to incomplete OpenCL support in clang). Use a modified
...
version of a test by Joey Gouly to use attributes to materialise the unsupported
types and test vector shifts.
llvm-svn: 172053
2013-01-10 10:42:08 +00:00
NAKAMURA Takumi
160087b1f6
clang/test/CodeGenOpenCL/shifts.cl: Fixup for -Asserts.
...
llvm-svn: 171820
2013-01-08 00:15:53 +00:00
David Tweed
042e0883cb
Scalar shifts in the OpenCL specification (as of v. 1.2) are defined to be
...
with respect to the lower "left-hand-side bitwidth" bits, even when negative);
see OpenCL spec 6.3j. This patch both implements this behaviour in the code
generator and "constant folding" bits of Sema, and also prevents tests
to detect undefinedness in terms of the weaker C99 or C++ specifications
from being applied.
llvm-svn: 171755
2013-01-07 16:43:27 +00:00
Guy Benyei
d8a08ea98d
Re-commit r170428 changes with Linux style file endings.
...
Add OpenCL images as clang builtin types.
llvm-svn: 170432
2012-12-18 14:38:23 +00:00
Guy Benyei
11169dded0
Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.
...
llvm-svn: 170431
2012-12-18 14:30:41 +00:00
Guy Benyei
b13abb952a
Add OpenCL images as clang builtin types.
...
llvm-svn: 170428
2012-12-18 12:30:03 +00:00
Richard Trieu
29a2ffc7aa
Fix line ending is tests. No functional change.
...
llvm-svn: 169947
2012-12-12 00:52:15 +00:00
Guy Benyei
b798fc9849
Add SPIR32/SPIR64 targets to Clang
...
llvm-svn: 169917
2012-12-11 21:38:14 +00:00
NAKAMURA Takumi
18fc445af5
FP_CONTRACT: Fix two tests for -Asserts.
...
llvm-svn: 165024
2012-10-02 16:36:54 +00:00
Lang Hames
5de91cc35f
Add FP_CONTRACT support for clang.
...
Clang will now honor the FP_CONTRACT pragma and emit LLVM
fmuladd intrinsics for expressions of the form A * B + C (when they occur in a
single statement).
llvm-svn: 164989
2012-10-02 04:45:10 +00:00
Tanya Lattner
bd837a8bde
Remove names from the CHECK lines.
...
llvm-svn: 162003
2012-08-16 00:22:16 +00:00
Tanya Lattner
a9dd49fe5b
Convert loads and stores of vec3 to vec4 to achieve better code generation. Add test case.
...
llvm-svn: 162002
2012-08-16 00:10:13 +00:00
Simon Atanasyan
38c63ed5f8
Fix the test case. Now it does not depend on the method used to pass vector arguments to the function.
...
Reviewed by Anton Lokhmotov.
llvm-svn: 161597
2012-08-09 17:49:22 +00:00
Tanya Lattner
7445ada9c8
Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
...
Includes a test case.
llvm-svn: 160092
2012-07-11 23:02:10 +00:00
Tanya Lattner
bcffcdfd18
Patch by Anton Lokhmotov to add OpenCL work group size attributes.
...
llvm-svn: 159965
2012-07-09 22:06:01 +00:00
Justin Holewinski
83e9668133
Replace PTX back-end with NVPTX back-end in all places where Clang cares
...
NV_CONTRIB
llvm-svn: 157403
2012-05-24 17:43:12 +00:00
Duncan Sands
6fc461984a
Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'm
...
thinking of generalizing it to be able to specify other freedoms beyond accuracy
(such as that NaN's don't have to be respected). I'd like the 3.1 release (the
first one with this metadata) to have the more generic name already rather than
having to auto-upgrade it in 3.2.
llvm-svn: 154745
2012-04-14 12:37:26 +00:00
Duncan Sands
e81111ca71
Express the number of ULPs in fpaccuracy metadata as a real rather than a
...
rational number, eg as 2.5 rather than 5, 2. OK'd by Peter Collingbourne.
llvm-svn: 154388
2012-04-10 08:23:07 +00:00
Tanya Lattner
3dd33b296a
A few style changes.
...
Change CheckVectorLogicalOperands to pass params by ref.
Add another test case.
llvm-svn: 148452
2012-01-19 01:16:16 +00:00
Eli Friedman
2dd5d653f2
Fix test so it doesn't depend on the host's calling convention lowering code.
...
llvm-svn: 147545
2012-01-04 20:43:57 +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
95fd2ca69f
Annotate imprecise FP division with fpaccuracy metadata
...
The OpenCL single precision division operation is only required to
be accurate to 2.5ulp. Annotate the fdiv instruction with metadata
which signals to the backend that an imprecise divide instruction
may be used.
llvm-svn: 143136
2011-10-27 19:19:51 +00:00
Justin Holewinski
38031978b5
PTX: Set proper calling conventions for PTX in OpenCL mode.
...
llvm-svn: 141193
2011-10-05 17:58:44 +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
Tanya Lattner
207189ef25
Do not violate the opencl casting rules. This test case still illustrates the problem. In the future, we should throw an error when doing invalid casting.
...
llvm-svn: 134570
2011-07-07 00:12:54 +00:00
Tanya Lattner
5bea4c3859
Modify test for 32 and 64 bit.
...
llvm-svn: 129627
2011-04-16 01:00:29 +00:00
Tanya Lattner
5ac257d738
Fix bug in vector initializer when initializing a vector with another vector.
...
Add test case.
llvm-svn: 129617
2011-04-15 22:42:59 +00:00
Peter Collingbourne
599cb8e430
Add support for language-specific address spaces. On top of that,
...
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.
llvm-svn: 127915
2011-03-18 22:38:29 +00:00
Peter Collingbourne
e91b2dbdf1
OpenCL: standardise naming of test cases
...
llvm-svn: 125590
2011-02-15 19:46:41 +00:00
Peter Collingbourne
7ce13fc940
OpenCL: add support for __kernel, kernel keywords and EXTENSION,
...
FP_CONTRACT pragmas. Patch originally by ARM.
llvm-svn: 125475
2011-02-14 01:42:53 +00:00