summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL
Commit message (Collapse)AuthorAgeFilesLines
...
* AMDGPU: Add amdgcn cube builtinsMatt Arsenault2016-01-261-0/+24
| | | | llvm-svn: 258794
* Recommit: R258773 [OpenCL] Pipe builtin functionsXiuli Pan2016-01-261-0/+61
| | | | | | | | | | | | | | | | | Fix arc patch fuzz error. Summary: Support for the pipe built-in functions for OpenCL 2.0. The pipe builtin functions may have infinite kinds of element types, one approach would be to just generate calls that would always use generic types such as void*. This patch is based on bader's opencl support patch on SPIR-V branch. Reviewers: Anastasia, pekka.jaaskelainen Subscribers: keryell, bader, cfe-commits Differential Revision: http://reviews.llvm.org/D15914 llvm-svn: 258782
* Revert "[OpenCL] Pipe builtin functions"David Majnemer2016-01-261-61/+0
| | | | | | | This reverts commit r258773, it broke the build bots: http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/43853 llvm-svn: 258775
* [OpenCL] Pipe builtin functionsXiuli Pan2016-01-261-0/+61
| | | | | | | | | | | | | | | | Summary: Support for the pipe built-in functions for OpenCL 2.0. The pipe builtin functions may have infinite kinds of element types, one approach would be to just generate calls that would always use generic types such as void*. This patch is based on bader's opencl support patch on SPIR-V branch. Reviewers: Anastasia, pekka.jaaskelainen Subscribers: keryell, bader, cfe-commits Differential Revision: http://reviews.llvm.org/D15914 llvm-svn: 258773
* AMDGPU: Add barrier builtinMatt Arsenault2016-01-221-0/+6
| | | | llvm-svn: 258564
* AMDGPU: Rename builtins to use amdgcn prefixMatt Arsenault2016-01-222-118/+180
| | | | | | | | | Keep the ones still used by libclc around for now. Emit the new amdgcn intrinsic name if not targeting r600, in which case the old AMDGPU name is still used. llvm-svn: 258560
* [Bugfix] Fix ICE on constexpr vector splat.George Burgess IV2016-01-131-0/+6
| | | | | | | | | | | | | In {CG,}ExprConstant.cpp, we weren't treating vector splats properly. This patch makes us treat splats more properly. Additionally, this patch adds a new cast kind which allows a bool->int cast to result in -1 or 0, instead of 1 or 0 (for true and false, respectively), so we can sanely model OpenCL bool->int casts in the AST. Differential Revision: http://reviews.llvm.org/D14877 llvm-svn: 257559
* [OpenCL] Pipe type supportXiuli Pan2016-01-091-0/+27
| | | | | | | | | | | | | | | Summary: Support for OpenCL 2.0 pipe type. This is a bug-fix version for bader's patch reviews.llvm.org/D14441 Reviewers: pekka.jaaskelainen, Anastasia Subscribers: bader, Anastasia, cfe-commits Differential Revision: http://reviews.llvm.org/D15603 llvm-svn: 257254
* [OpenCL 2.0] Apply default address space (AS).Anastasia Stulova2015-11-231-17/+37
| | | | | | | | | | | | If AS of a variable/parameter declaration is not set by the source, OpenCL v2.0 s6.5 defines explicit rules for default ASes: - The AS of global and local static variables defaults to global; - All pointers point to generic AS. http://reviews.llvm.org/D13168 llvm-svn: 253863
* [OpenCL] Fix casting a true boolean to an integer vector.Anastasia Stulova2015-10-051-0/+27
| | | | | | | | | | | | | OpenCL v1.1 s6.2.2: for the boolean value true, every bit in the result vector should be set. This change treats the i1 value as signed for the purposes of performing the cast to integer, and therefore sign extend into the result. Patch by Neil Hickey! http://reviews.llvm.org/D13349 llvm-svn: 249301
* Fix invalid shufflevector operandsSimon Pilgrim2015-08-021-0/+13
| | | | | | | | | | This patch fixes bug 23800 ( https://llvm.org/bugs/show_bug.cgi?id=23800#c2 ). There existed a case where the index operand from extractelement was directly used to create a shufflevector mask. Since the index can be of any integral type but the mask must only contain 32 bit integers a 64 bit index operand led to an assertion error later on. Committed on behalf of mpflanzer (Moritz Pflanzer) Differential Revision: http://reviews.llvm.org/D10838 llvm-svn: 243851
* Account for calling convention specifiers in function definitions in IR test ↵David Blaikie2015-06-293-6/+6
| | | | | | | | | | | | | cases Several tests wouldn't pass when executed on an armv7a_pc_linux triple due to the non-default arm_aapcs calling convention produced on the function definitions in the IR output. Account for this with the application of a little regex. Patch by Ying Yi. llvm-svn: 240971
* clang/test/CodeGenOpenCL/opencl_types.cl: Tweak expressions according to ↵NAKAMURA Takumi2015-05-181-1/+1
| | | | | | | | | | | r237548. With MS mangler, the signature is: x86: define void @"\01?bad1@@$$J0YAXPAPAUocl_image1d@@PAPAUocl_image2d@@1@Z" (%opencl.image1d_t** %b, %opencl.image2d_t** %c, %opencl.image2d_t** %d) nounwind x64: define void @"\01?bad1@@$$J0YAXPEAPAUocl_image1d@@PEAPAUocl_image2d@@1@Z"(%opencl.image1d_t** %b, %opencl.image2d_t** %c, %opencl.image2d_t** %d) nounwind llvm-svn: 237551
* Remove the cl-no-signed-zeros cc1 optionSanjay Patel2015-04-041-2/+0
| | | | | | | | | | | | Use the driver flag -fno-signed-zeros instead. This was recommended but not implemented in D6873: http://reviews.llvm.org/D6873 which was checked in at r226915: http://reviews.llvm.org/rL226915 llvm-svn: 234093
* Sema: Accept pointers to any address space for builtin functionsTom Stellard2015-03-311-0/+8
| | | | | | | | As long as they don't have an address space explicitly defined. This allows builtins with pointer arguments to be used with OpenCL. llvm-svn: 233706
* [CodeGen] Support native half inc/dec amounts.Ahmed Bougacha2015-03-241-0/+8
| | | | | | | | We previously defaulted to long double, but it's also possible to have a half inc/dec amount, when LangOpts NativeHalfType is set. Currently, that's only true for OpenCL. llvm-svn: 233135
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-132-2/+2
| | | | llvm-svn: 232187
* Restores r228382, which was reverted in r228406.Sameer Sahasrabuddhe2015-02-251-25/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert r229409: "Hack to try deleting file from build bots"Matt Arsenault2015-02-161-1/+0
| | | | llvm-svn: 229411
* Hack to try deleting file from build botsMatt Arsenault2015-02-161-0/+1
| | | | llvm-svn: 229409
* Don't create output file in testMatt Arsenault2015-02-161-1/+1
| | | | llvm-svn: 229407
* OpenCL: Accept -cl-strict-aliasingMatt Arsenault2015-02-161-0/+1
| | | | | | | This was in 1.0, but deprecated in 1.1. Accept it and do nothing for compatability. llvm-svn: 229403
* Revert "OpenCL: handle shift operator with vector operands"Tom Stellard2015-02-061-41/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* OpenCL: handle shift operator with vector operandsSameer Sahasrabuddhe2015-02-061-25/+41
| | | | | | | | | | | | | | | | | | | | 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
* Re-apply "r226548 - Introduce SPIR calling conventions" reverted in r226558.Alexander Kornienko2015-01-201-0/+18
| | | | | | | | | | | | | | | | | | | | | | | The test was fixed after a discussion with the revision author: the check pattern was made more flexible as the "%call" part is not what we actually want to check strictly there. The original patch description: === Introduce SPIR calling conventions. This implements Section 3.7 from the SPIR 1.2 spec: SPIR kernels should use "spir_kernel" calling convention. Non-kernel functions use "spir_func" calling convention. All other calling conventions are disallowed. The patch works only for OpenCL source. Any other uses will need to ensure that kernels are assigned the spir_kernel calling convention correctly. === llvm-svn: 226561
* Reverting r226548 as one of the tests fails in some configurations.Alexander Kornienko2015-01-201-18/+0
| | | | | | | | | | | | | | | | | | | | | | Here's the fail log from our internal setup: === .../tools/clang/clang -cc1 -internal-isystem .../tools/clang/staging/include -nostdsysteminc .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl -triple spir-unknown-unknown -emit-llvm -o - FileCheck .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl .../tools/clang/test/CodeGenOpenCL/spir-calling-conv.cl:11:12: error: expected string not found in input // CHECK: %call = tail call spir_func i32 @get_dummy_id(i32 0) ^ <stdin>:6:52: note: scanning from here define spir_kernel void @foo(i32 addrspace(1)* %A) #0 { ^ <stdin>:7:2: note: possible intended match here %1 = tail call spir_func i32 @get_dummy_id(i32 0) #2 ^ === Here's a failure on a public CI server: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/1183/ llvm-svn: 226558
* Introduce SPIR calling conventions.Sameer Sahasrabuddhe2015-01-201-0/+18
| | | | | | | | | | | | | | This implements Section 3.7 from the SPIR 1.2 spec: SPIR kernels should use "spir_kernel" calling convention. Non-kernel functions use "spir_func" calling convention. All other calling conventions are disallowed. The patch works only for OpenCL source. Any other uses will need to ensure that kernels are assigned the spir_kernel calling convention correctly. llvm-svn: 226548
* Add __builtin_amdgpu_classMatt Arsenault2015-01-061-0/+14
| | | | llvm-svn: 225314
* R600: Handle amdgcn tripleTom Stellard2015-01-062-1/+2
| | | | | | For now there is no difference between amdgcn and r600. llvm-svn: 225294
* Fix an address space id reset with array decay'sPekka Jaaskelainen2014-12-191-0/+11
| | | | | | | | | | implicit conversion. The issue was produced with OpenCL C code that called a function with a constant string literal argument. llvm-svn: 224592
* IR: Make metadata typeless in assembly, clang sideDuncan P. N. Exon Smith2014-12-156-48/+48
| | | | | | Match LLVM changes from r224257. llvm-svn: 224259
* OpenCL C: Add support for a set of floating point Pekka Jaaskelainen2014-12-101-0/+36
| | | | | | | | | | | | | | arithmetic relaxation flags: -cl-no-signed-zeros -cl-unsafe-math-optimizations -cl-finite-math-only -cl-fast-relaxed-math Propagate the info to FP instruction flags as well as function attributes where they are available. llvm-svn: 223928
* Add attributes for AMDGPU register limits.Matt Arsenault2014-12-041-0/+48
| | | | | | | This is a performance hint that can be applied to kernels to attempt to limit the number of used registers. llvm-svn: 223384
* Always emit kernel arg info for SPIR.Sameer Sahasrabuddhe2014-12-043-9/+20
| | | | | | | | | | | | | | | http://llvm.org/bugs/show_bug.cgi?id=21555 Currently, kernel argument metadata is omitted unless the "-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec requires that all metadata except kernel_arg_name should always be emitted, and kernel_arg_name is only emitted when "-cl-kernel-arg-info" is specified. Patch ported by Ryan Burn from the Khronos SPIR generator. https://github.com/KhronosGroup/SPIR llvm-svn: 223340
* clang/test/CodeGenOpenCL/opencl_types.cl: Appease i686-msvc.NAKAMURA Takumi2014-11-301-1/+1
| | | | llvm-svn: 222969
* Tweak clang/test/CodeGenOpenCL/opencl_types.cl to appease msvc since r222941.NAKAMURA Takumi2014-11-291-1/+1
| | | | llvm-svn: 222956
* AST: Consider pseudo-struct builtin types as substitutableDavid Majnemer2014-11-281-0/+3
| | | | | | | | We didn't consider types like ObjCSel as a substitution candidate. This fixes PR21688. llvm-svn: 222941
* OpenCL: fix test for lack of names in release buildsTim Northover2014-11-261-2/+2
| | | | llvm-svn: 222853
* Adding an explicit triple to this test to get it to pass all build bots.Aaron Ballman2014-11-261-1/+1
| | | | llvm-svn: 222837
* [OpenCL] Implemented restrictions for pointer conversions specified in ↵Anastasia Stulova2014-11-261-0/+22
| | | | | | | | | | | | 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
* Emit OpenCL local global variables without zeorinitializerMatt Arsenault2014-11-032-2/+28
| | | | | | | | Local variables are not initialized, and every target has been (incorrectly) ignoring the unnecessary request for zero initialization. llvm-svn: 221162
* Prune CRLF.NAKAMURA Takumi2014-10-271-23/+23
| | | | llvm-svn: 220678
* R600: Update for div_fmas intrinsic changeMatt Arsenault2014-10-211-4/+4
| | | | llvm-svn: 220339
* OpenCL: Emit global variables in the constant addr space as constant globalsTom Stellard2014-10-164-4/+12
| | | | llvm-svn: 219929
* Driver: Implement -cl-denorms-are-zeroTom Stellard2014-08-211-0/+5
| | | | | | This is currently a no-op, which is allowed by the OpenCL specification. llvm-svn: 216179
* R600: Add ldexp intrinsicMatt Arsenault2014-08-151-0/+14
| | | | llvm-svn: 215738
* Add OpenCL/SPIR kernel_arg_base_type metadata nodeFraser Cormack2014-07-301-0/+12
| | | | | | | | | | | | | | As defined in the SPIR 1.2 specification, this node behaves similarly to kernel_arg_type but will print the underlying type name, e.g., without typedefs. Example: typedef unsigned int myunsignedint; would report: 'myunsignedint' in the kernel_arg_type node 'uint' in the kernel_arg_base_type node llvm-svn: 214308
* Fix OpenCL/SPIR kernel_arg_type metadata nodeFraser Cormack2014-07-301-0/+9
| | | | | | | | | | | | This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u' for any parameter type, including non-canonical types. Example: typedef unsigned int myunsignedint; would report: "myunt" llvm-svn: 214305
* Add codegen for more R600 builtinsMatt Arsenault2014-07-151-0/+84
| | | | llvm-svn: 213079
* Add R600 builtin codegen.Matt Arsenault2014-06-241-0/+30
| | | | llvm-svn: 211631
OpenPOWER on IntegriCloud