summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenCL] AMDGCN target will generate images in constant address spaceYaxun Liu2016-07-201-15/+24
| | | | | | | | | | | | | Allows AMDGCN target to generate images (such as %opencl.image2d_t) in constant address space. Images will still be generated in global address space by default. Added tests to existing opencl-types.cl in test\CodeGenOpenCL. Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D22523 llvm-svn: 276161
* Let FuncAttrs infer the 'returned' argument attributeDavid Majnemer2016-07-191-1/+1
| | | | | | This reverts commit r275756. llvm-svn: 276014
* [OpenCL] Fixes bug of missing OCL version metadata on the AMDGCN targetYaxun Liu2016-07-191-17/+30
| | | | | | | | | | | | Added the opencl.ocl.version metadata to be emitted with amdgcn. Created a static function emitOCLVerMD which is shared between triple spir and target amdgcn. Also added new testcases to existing test file, spir_version.cl inside test/CodeGenOpenCL. Patch by Aaron En Ye Shi. Differential Revision: https://reviews.llvm.org/D22424 llvm-svn: 276010
* Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' ↵NAKAMURA Takumi2016-07-181-1/+1
| | | | | | | | | | argument attribute"" This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute" It broke LTO build. Seems miscompilation. llvm-svn: 275756
* Revert "Revert r275029 - Update Clang tests after adding inference for the ↵Hal Finkel2016-07-161-1/+1
| | | | | | | | returned argument attribute" This reverts commit r275043 after reapplying the underlying LLVM commit. llvm-svn: 275679
* AMDGPU: Remove legacy ldexp builtinMatt Arsenault2016-07-152-32/+0
| | | | llvm-svn: 275623
* AMDGPU: Update for rsq intrinsic changesMatt Arsenault2016-07-152-22/+8
| | | | llvm-svn: 275622
* AMDGPU: Add Clang Builtin for v_lerp_u8Wei Ding2016-07-151-0/+7
| | | | | | Differential Revision: http://reviews.llvm.org/D22380 llvm-svn: 275577
* [OpenCL] Fix code generation of kernel pipe parameters.Alexey Bader2016-07-131-0/+20
| | | | | | | | | | | Improved test with user define structure pipe type case. Reviewers: Anastasia, pxli168 Subscribers: yaxunl, cfe-commits Differential revision: http://reviews.llvm.org/D21744 llvm-svn: 275259
* Revert r275029 - Update Clang tests after adding inference for the returned ↵Hal Finkel2016-07-111-1/+1
| | | | | | | | argument attribute The associated backend change is causing miscompiles from the AArch64 backend. llvm-svn: 275043
* AMDGPU: Export workitem builtinsJan Vesely2016-07-102-1/+81
| | | | | | | | Reviewers: tstellardAMD Differential Revision: http://reviews.llvm.org/D20299 llvm-svn: 275030
* Update Clang tests after adding inference for the returned argument attributeHal Finkel2016-07-101-1/+1
| | | | | | Adjusting tests after r275027. llvm-svn: 275029
* [OpenCL] Add missing -cl-no-signed-zeros option into driverYaxun Liu2016-07-081-0/+10
| | | | | | | | | | | | Add OCL option -cl-no-signed-zeros to driver options. Also added to opencl.cl testcases. Patch by Aaron En Ye Shi. Differential Revision: http://reviews.llvm.org/D22067 llvm-svn: 274923
* [OpenCL] Fix access qualifiers handling for typedefsAlexey Bader2016-07-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | OpenCL s6.6: "Access qualifier must be used with image object arguments of kernels and of user-defined functions [...] If no qualifier is provided, read_only is assumed". This does not define the behavior for image types used in typedef declaration, but following the spec logic, we should allow access qualifiers specification in typedefs, e.g.: typedef write_only image1d_t img1d_wo; Unlike cv-qualifiers, user cannot add access qualifier to a typedef type, i.e. this is not allowed: typedef image1d_t img1d; // note: previously declared 'read_only' here void foo(write_only img1d im) {} // error: multiple access qualifier Patch by Andrew Savonichev. Reviewers: Anastasia Stulova. Differential revision: http://reviews.llvm.org/D20948 llvm-svn: 274858
* [OpenCL] An implementation of device side enqueue (DSE) from OpenCL v2.0 ↵Anastasia Stulova2016-07-051-0/+110
| | | | | | | | | | | | | | | | | s6.13.17. - Added new Builtins: enqueue_kernel, get_kernel_work_group_size and get_kernel_preferred_work_group_size_multiple. These Builtins use custom check to diagnose parameters of the passed Blocks i. e. variable number of 'local void*' type params, and check different overloads specified in Table 6.31 of OpenCL v2.0. - IR is generated as an internal library call for each OpenCL Builtin, reusing ObjC Block implementation. Review: http://reviews.llvm.org/D20249 llvm-svn: 274540
* AMDGPU: Set amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-06-303-4/+30
| | | | | | | | | | | | | | | | | | Summary: Summary: Change Clang calling convention SpirKernel to OpenCLKernel. Set calling convention OpenCLKernel for amdgcn as well. Add virtual method .getOpenCLKernelCallingConv() to TargetCodeGenInfo and use it to set target calling convention for AMDGPU and SPIR. Update tests. Reviewers: rsmith, tstellarAMD, Anastasia, yaxunl Subscribers: kzhuravl, cfe-commits Differential Revision: http://reviews.llvm.org/D21367 llvm-svn: 274220
* [OpenCL] Fix typo in as_type test.Alexey Bader2016-06-291-1/+1
| | | | | | Reset astype variable in f6 function to avoid matching with wrong value from f5 function. llvm-svn: 274120
* AMDGPU: Add builtin to read exec maskMatt Arsenault2016-06-281-0/+12
| | | | llvm-svn: 273965
* Attempt to fix MIPS buildbots after r273425.Daniel Sanders2016-06-231-2/+2
| | | | | | MIPS has a 'signext' attribute that was causing the check to fail. llvm-svn: 273552
* [OpenCL] Use function metadata to represent kernel attributesYaxun Liu2016-06-223-51/+77
| | | | | | | | This patch uses function metadata to represent reqd_work_group_size, work_group_size_hint and vector_type_hint kernel attributes and kernel argument info. Differential Revision: http://reviews.llvm.org/D20979 llvm-svn: 273425
* Update clang for D20348Peter Collingbourne2016-06-143-3/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D20339 llvm-svn: 272710
* [OpenCL] Fix __builtin_astype for vec3 types.Yaxun Liu2016-06-081-0/+68
| | | | | | | | __builtin_astype does not generate correct LLVM IR for vec3 types. This patch inserts bitcasts to/from vec4 when necessary in addition to generating vector shuffle. Sema and codegen tests are added. Differential Revision: http://reviews.llvm.org/D20133 llvm-svn: 272153
* AMDGPU: Verify subtarget specific builtinsMatt Arsenault2016-06-084-14/+39
| | | | | | Cleanup setup of subtarget features. llvm-svn: 272091
* [OPENCL] Fix wrongly vla error for OpenCL array.Xiuli Pan2016-06-071-0/+18
| | | | | | | | | | | | | | | | | Summary: OpenCL should support array with const value size length, those const varibale in global and constant address space and variable in constant address space. Fixed test case error. Reviewers: Anastasia, yaxunl, bader Subscribers: bader, cfe-commits Differential Revision: http://reviews.llvm.org/D20090 llvm-svn: 271978
* Revert "[OPENCL] Fix wrongly vla error for OpenCL array."Xiuli Pan2016-06-071-18/+0
| | | | | | | | Test case break on system-z. This reverts commit 9a7212e1e87f1396952d74f8c62314a775ccbb1c. llvm-svn: 271975
* [OPENCL] Fix wrongly vla error for OpenCL array.Xiuli Pan2016-06-071-0/+18
| | | | | | | | | | | | | Summary: OpenCL should support array with const value size length, those const varibale in global and constant address space and variable in constant address space. Reviewers: Anastasia, yaxunl, bader Subscribers: bader, cfe-commits Differential Revision: http://reviews.llvm.org/D20090 llvm-svn: 271971
* AMDGPU: Add fract builtinMatt Arsenault2016-05-281-0/+14
| | | | llvm-svn: 271080
* [OpenCL] Add to_{global|local|private} builtin functions.Yaxun Liu2016-05-201-0/+89
| | | | | | | | | | | | | | | | | | OpenCL builtin functions to_{global|local|private} accepts argument of pointer type to arbitrary pointee type, and return a pointer to the same pointee type in different addr space, i.e. global gentype *to_global(gentype *p); It is not desirable to declare it as global void *to_global(void *); in opencl header file since it misses diagnostics. This patch implements these builtin functions as Clang builtin functions. In the builtin def file they are defined to have signature void*(void*). When handling call expressions, their declarations are re-written to have correct parameter type and return type corresponding to the call argument. In codegen call to addr void *to_addr(void*) is generated with addrcasts or bitcasts to facilitate implementation in builtin library. Differential Revision: http://reviews.llvm.org/D19932 llvm-svn: 270261
* [OpenCL] Allow explicit cast of 0 to event_t.Yaxun Liu2016-05-201-0/+2
| | | | | | | | Patch by Aaron Enye Shi. Differential Revision: http://reviews.llvm.org/D17578 llvm-svn: 270238
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-163-3/+3
| | | | | | | | | | Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Re-commit after fixing build error due to missing override attribute. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269670
* Revert "[OpenCL] Add supported OpenCL extensions to target info."Yaxun Liu2016-05-133-3/+3
| | | | | | | | | Revert r269431 due to build failure caused by warning msg: llvm/tools/clang/lib/Basic/Targets.cpp:2090:9: error: 'setSupportedOpenCLOpts' overrides a member function but is not marked 'override' [-Werror,-Winconsistent-missing-override] void setSupportedOpenCLOpts() { llvm-svn: 269435
* [OpenCL] Add supported OpenCL extensions to target info.Yaxun Liu2016-05-133-3/+3
| | | | | | | | Add supported OpenCL extensions to target info. It serves as default values to save the users of the burden setting each supported extensions and optional core features in command line. Differential Revision: http://reviews.llvm.org/D19484 llvm-svn: 269431
* Revert "AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels."Nikolay Haustov2016-05-062-16/+4
| | | | | | | | This reverts commit f7053ec90d0fc56f0837e43c2c759e85b56c21a1. It broke calling OpenCL kernel from another kernel. llvm-svn: 268740
* AMDGPU/SI: Use amdgpu_kernel calling convention for OpenCL kernels.Nikolay Haustov2016-05-062-4/+16
| | | | | | | | | | Reviewers: tstellarAMD, arsenm Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19918 llvm-svn: 268718
* [OpenCL] Fix bug in mergeTypes which causes equivalent types treated as ↵Yaxun Liu2016-04-281-1/+10
| | | | | | | | | | different. When comparing unqualified types, canonical types should be used, otherwise equivalent types may be treated as different type. Differential Revision: http://reviews.llvm.org/D19662 llvm-svn: 267906
* AMDGPU: Add test for generic builtin behaviorMatt Arsenault2016-04-141-0/+16
| | | | llvm-svn: 266383
* PR19957: [OpenCL] Incorrectly accepts implicit address space conversion with ↵Yaxun Liu2016-04-121-0/+39
| | | | | | | | | | | | ternary operator. Generates addrspacecast instead of bitcast for ternary operator when necessary, and diagnose ternary operator with incompatible second and third operands. https://llvm.org/bugs/show_bug.cgi?id=19957 Differential Revision: http://reviews.llvm.org/D17412 llvm-svn: 266111
* [OpenCL] Handle AddressSpaceConversion when target address space does not ↵Yaxun Liu2016-04-121-0/+18
| | | | | | | | | | | | | change. In codegen different address spaces may be mapped to the same address space for a target, e.g. in x86/x86-64 all address spaces are mapped to 0. Therefore AddressSpaceConversion should be translated by CreatePointerBitCastOrAddrSpaceCast instead of CreateAddrSpaceCast. Differential Revision: http://reviews.llvm.org/D18713 llvm-svn: 266107
* Verify commit right by adding a blank line to ↵Yaxun Liu2016-04-121-0/+1
| | | | | | test/CodeGenOpenCL/address-spaces-conversions.cl. llvm-svn: 266083
* [OpenCL] Complete image types support.Alexey Bader2016-04-082-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I. Current implementation of images is not conformant to spec in the following points: 1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine: void write_image(write_only image2d_t img); kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code which is disallowed according to s6.13.14. 2. It discards access qualifier on generated code, which leads to generated code for the above example: call void @write_image(%opencl.image2d_t* %img); In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images. Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently. 3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names. 4. Default access qualifier read_only is to be added if not provided explicitly. II. This patch corrects the above points as follows: 1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type. 2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers). 3. Improves testing of images in Clang. Author: Anastasia Stulova Reviewers: bader, mgrang. Subscribers: pxli168, pekka.jaaskelainen, yaxunl. Differential Revision: http://reviews.llvm.org/D17821 llvm-svn: 265783
* AMDGPU: Add frexp_mant + frexp_exp builtinsMatt Arsenault2016-03-301-0/+28
| | | | llvm-svn: 264960
* [OpenCL] Add ocl and spir version for spir targetXiuli Pan2016-03-241-0/+18
| | | | | | | | | | | | Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version. Reviewers: yaxunl, Anastasia Subscribers: cfe-commits, pekka.jaaskelainen Differential Revision: http://reviews.llvm.org/D17596 llvm-svn: 264241
* AMDGPU: Add builtins for recently added intrinsicsMatt Arsenault2016-02-271-0/+25
| | | | llvm-svn: 262126
* AMDGPU: Fix inconsistent register name for flat_scratchMatt Arsenault2016-02-271-0/+15
| | | | llvm-svn: 262123
* Fix Clang tests that used CHECK-NEXT-NOT and CHECK-DAG-NOT.Paul Robinson2016-02-261-2/+2
| | | | | | | | FileCheck actually doesn't support combo suffixes. Differential Revision: http://reviews.llvm.org/D17589 llvm-svn: 262052
* [OpenCL] Add Sema checks for typesXiuli Pan2016-02-251-2/+2
| | | | | | | | | | | | | | Summary: Add Sema checks for opencl type: image, pipe.... This patch is partitioned from http://reviews.llvm.org/D16047 Reviewers: Anastasia, yaxunl Subscribers: pekka.jaaskelainen, cfe-commits Differential Revision: http://reviews.llvm.org/D17437 llvm-svn: 261818
* [OpenCL] Generate metadata for opencl_unroll_hint attributeAnastasia Stulova2016-02-191-0/+96
| | | | | | | | | | | | | | | Add support for opencl_unroll_hint attribute from OpenCL v2.0 s6.11.5. Reusing most of metadata generation from CGLoopInfo helper class. The code is based on Khronos OpenCL compiler: https://github.com/KhronosGroup/SPIR/tree/spirv-1.0 Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16686 llvm-svn: 261350
* AMDGPU: Add sin/cos builtinsMatt Arsenault2016-02-131-0/+21
| | | | llvm-svn: 260783
* AMDGPU: Update builtin for intrinsic changeMatt Arsenault2016-02-131-8/+8
| | | | llvm-svn: 260781
* Add target triple to CodeGenOpenCL/pipe_types.cl test caseUlrich Weigand2016-01-291-1/+1
| | | | | | | | | The test is failing on SystemZ since different IR is being generated due to platform ABI differences. Add a target triple. Fix suggested by Anastasia Stulova. llvm-svn: 259183
OpenPOWER on IntegriCloud