summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenOpenCL
Commit message (Collapse)AuthorAgeFilesLines
* [OpenCL] Fix mangling of single-overload builtinsSven van Haastregt2019-12-031-0/+7
| | | | | | Commit 9a8d477a0e0 ("[OpenCL] Add builtin function attribute handling", 2019-11-05) stopped Clang from mangling single-overload builtins, which is incorrect.
* [OpenCL] Add builtin function attribute handlingSven van Haastregt2019-11-051-0/+22
| | | | | | | | | Add handling for the "pure", "const" and "convergent" function attributes for OpenCL builtin functions. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D64319
* AMDGPU: Add builtins for is_shared/is_privateMatt Arsenault2019-09-052-13/+41
| | | | llvm-svn: 371010
* AMDGPU: Always emit amdgpu-flat-work-group-sizeMatt Arsenault2019-08-271-14/+21
| | | | | | | The backend default maximum should be the hardware maximum, so the frontend should set the implementation defined default maximum. llvm-svn: 370101
* Builtins: Start adding half versions of math builtinsMatt Arsenault2019-08-061-0/+71
| | | | | | | | | | The implementation of the OpenCL builtin currently library uses 2 different hacks to get to the corresponding IR intrinsics from the source. This will allow removal of those. This is the set that is currently used (minus a few vector ones). llvm-svn: 367973
* [OpenCL] Fix vector literal test broken in rL367675.Anastasia Stulova2019-08-051-2/+2
| | | | | | | Avoid checking alignment unnecessary that is not portable among targets. llvm-svn: 367823
* IR: print value numbers for unnamed function argumentsTim Northover2019-08-032-6/+6
| | | | | | | | | | For consistency with normal instructions and clarity when reading IR, it's best to print the %0, %1, ... names of function arguments in definitions. Also modifies the parser to accept IR in that form for obvious reasons. llvm-svn: 367755
* [OpenCL] Allow OpenCL C style vector initialization in C++Anastasia Stulova2019-08-022-39/+59
| | | | | | | | | | | Allow creating vector literals from other vectors. float4 a = (float4)(1.0f, 2.0f, 3.0f, 4.0f); float4 v = (float4)(a.s23, a.s01); Differential revision: https://reviews.llvm.org/D65286 llvm-svn: 367675
* AMDGPU: Add missing builtin declarationsMatt Arsenault2019-07-311-0/+43
| | | | llvm-svn: 367431
* [OpenCL] Rename lang mode flag for C++ modeAnastasia Stulova2019-07-257-7/+7
| | | | | | | | | | | | Rename lang mode flag to -cl-std=clc++/-cl-std=CLC++ or -std=clc++/-std=CLC++. This aligns with OpenCL C conversion and removes ambiguity with OpenCL C++. Differential Revision: https://reviews.llvm.org/D65102 llvm-svn: 367008
* Updated the signature for some stack related intrinsics (CLANG)Christudasan Devadasan2019-07-221-0/+5
| | | | | | | | | | | | | Modified the intrinsics int_addressofreturnaddress, int_frameaddress & int_sponentry. This commit depends on the changes in rL366679 Reviewed By: arsenm Differential Revision: https://reviews.llvm.org/D64563 llvm-svn: 366683
* AMDGPU: Add some missing builtinsMatt Arsenault2019-07-172-0/+88
| | | | llvm-svn: 366286
* [OpenCL] Fixing sampler initialisations for C++ mode.Neil Hickey2019-07-161-9/+10
| | | | | | | | Allow conversions between integer and sampler type. Differential Revision: https://reviews.llvm.org/D64791 llvm-svn: 366212
* [clang] Preserve names of addrspacecast'ed values.Vyacheslav Zakharin2019-07-101-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D63846 llvm-svn: 365666
* [AMDGPU] Increased the number of implicit argument bytes for both OpenCL and ↵Christudasan Devadasan2019-07-101-25/+25
| | | | | | | | | | | | | HIP (CLANG). To enable a new implicit kernel argument, increased the number of argument bytes from 48 to 56. Reviewed By: yaxunl Differential Revision: https://reviews.llvm.org/D63756 llvm-svn: 365643
* Use the Itanium C++ ABI for the pipe_builtin.cl testReid Kleckner2019-07-091-1/+3
| | | | | | | Certain OpenCL constructs cannot yet be mangled in the MS C++ ABI. Add a FIXME for it if anyone cares to implement it. llvm-svn: 365557
* [AMDGPU] gfx908 clang targetStanislav Mekhanoshin2019-07-091-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D64430 llvm-svn: 365528
* [OpenCL][Sema] Fix builtin rewritingMarco Antognini2019-07-093-3/+3
| | | | | | | | | | | This patch ensures built-in functions are rewritten using the proper parent declaration. Existing tests are modified to run in C++ mode to ensure the functionality works also with C++ for OpenCL while not increasing the testing runtime. llvm-svn: 365499
* Add nofree attribute to CodeGenOpenCL/convergent.cl testBrian Homerding2019-07-081-1/+1
| | | | | | | | | The revision at https://reviews.llvm.org/rL365336 added inference of the nofree attribute. This revision updates the test to reflect this. Differential Revision: https://reviews.llvm.org/D49165 llvm-svn: 365341
* AMDGPU: Fix missing declaration for mbcnt builtinsMatt Arsenault2019-06-241-0/+12
| | | | llvm-svn: 364251
* [clang][NewPM] Add RUNS for tests that produce slightly different IR under ↵Leonard Chan2019-06-241-2/+8
| | | | | | | | | | new PM For CodeGenOpenCL/convergent.cl, the new PM produced a slightly different for loop, but this still checks for no loop unrolling as intended. This is committed separately from D63174. llvm-svn: 364202
* AMDGPU: Fix target builtins for gfx10Matt Arsenault2019-06-227-3/+12
| | | | | | This wasn't setting some of the features from older generations. llvm-svn: 364123
* AMDGPU: Add DS GWS sema builtinsMatt Arsenault2019-06-202-0/+26
| | | | llvm-svn: 363986
* Reapply "r363684: AMDGPU: Add GWS instruction builtins"Matt Arsenault2019-06-191-0/+12
| | | | llvm-svn: 363871
* Revert rL363684 : AMDGPU: Add GWS instruction builtinsSimon Pilgrim2019-06-191-12/+0
| | | | | | | ........ Depends on rL363678 which was reverted at rL363797 llvm-svn: 363824
* AMDGPU: Add GWS instruction builtinsMatt Arsenault2019-06-181-0/+12
| | | | llvm-svn: 363684
* [AMDGPU] gfx1011/gfx1012 clang supportStanislav Mekhanoshin2019-06-141-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D63308 llvm-svn: 363345
* [AMDGPU] gfx1010 wave32 clang supportStanislav Mekhanoshin2019-06-131-6/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D63209 llvm-svn: 363341
* LLVM IR: Generate new-style byval-with-Type from ClangTim Northover2019-06-054-24/+24
| | | | | | | | | | | LLVM IR recently added a Type parameter to the byval Attribute, so that when pointers become opaque and no longer have an element type the information will still be present in IR. For now the Type parameter is optional (which is why Clang didn't need this change at the time), but it will become mandatory soon. llvm-svn: 362652
* Reapply: LLVM IR: update Clang tests for byval being a typed attribute.Tim Northover2019-05-302-11/+11
| | | | | | | | | | Since byval is now a typed attribute it gets sorted slightly differently by LLVM when the order of attributes is being canonicalized. This updates the few Clang tests that depend on the old order. Clang patch is unchanged. llvm-svn: 362129
* [OpenCL] Fix OpenCL/SPIR version metadata in C++ mode.Anastasia Stulova2019-05-301-0/+3
| | | | | | | | | C++ is derived from OpenCL v2.0 therefore set the versions identically. Differential Revision: https://reviews.llvm.org/D62657 llvm-svn: 362102
* [OpenCL] Support logical vector operators in C++ modeSven van Haastregt2019-05-301-0/+1
| | | | | | | | | Support logical operators on vectors in C++ for OpenCL mode, to preserve backwards compatibility with OpenCL C. Differential Revision: https://reviews.llvm.org/D62588 llvm-svn: 362087
* Revert "LLVM IR: update Clang tests for byval being a typed attribute."Tim Northover2019-05-292-11/+11
| | | | | | The underlying LLVM change couldn't cope with llvm-link and broke LTO builds. llvm-svn: 362028
* LLVM IR: update Clang tests for byval being a typed attribute.Tim Northover2019-05-292-11/+11
| | | | | | | | Since byval is now a typed attribute it gets sorted slightly differently by LLVM when the order of attributes is being canonicalized. This updates the few Clang tests that depend on the old order. llvm-svn: 362013
* [OpenCL] Fix file-scope const sampler variable for 2.0Yaxun Liu2019-05-271-2/+13
| | | | | | | | | | | | | | | | | | | OpenCL spec v2.0 s6.13.14: Samplers can also be declared as global constants in the program source using the following syntax. const sampler_t <sampler name> = <value> This works fine for OpenCL 1.2 but fails for 2.0, because clang duduces address space of file-scope const sampler variable to be in global address space whereas spec v2.0 s6.9.b forbids file-scope sampler variable to be in global address space. The fix is not to deduce address space for file-scope sampler variables. Differential Revision: https://reviews.llvm.org/D62197 llvm-svn: 361757
* [OpenCL] Add support for the cl_arm_integer_dot_product extensionsKevin Petit2019-05-241-0/+38
| | | | | | | | | The specification is available in the Khronos OpenCL registry: https://www.khronos.org/registry/OpenCL/extensions/arm/cl_arm_integer_dot_product.txt Signed-off-by: Kevin Petit <kevin.petit@arm.com> llvm-svn: 361641
* [NFC] Fix line endings in OpenCL testsSven van Haastregt2019-05-171-10/+10
| | | | llvm-svn: 361004
* [AMDGPU] gfx1010 clang targetStanislav Mekhanoshin2019-05-131-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D61875 llvm-svn: 360634
* [Sema][OpenCL] Make address space conversions a bit stricter.Anastasia Stulova2019-05-081-11/+2
| | | | | | | | | | | | | | | | | | | | | | | | The semantics for converting nested pointers between address spaces are not very well defined. Some conversions which do not really carry any meaning only produce warnings, and in some cases warnings hide invalid conversions, such as 'global int*' to 'local float*'! This patch changes the logic in checkPointerTypesForAssignment and checkAddressSpaceCast to fail properly on implicit conversions that should definitely not be permitted. We also dig deeper into the pointer types and warn on explicit conversions where the address space in a nested pointer changes, regardless of whether the address space is compatible with the corresponding pointer nesting level on the destination type. Fixes PR39674! Patch by ebevhan (Bevin Hansson)! Differential Revision: https://reviews.llvm.org/D58236 llvm-svn: 360258
* Move setTargetAttributes after setGVProperties in SetFunctionAttributesScott Linder2019-04-231-0/+51
| | | | | | | | | | | AMDGPU currently relies on global properties being set before setTargetProperties is called. Existing targets like MIPS which rely on setTargetProperties do not rely on the current behavior, so this patch moves the call later in SetFunctionAttributes. Differential Revision: https://reviews.llvm.org/D60967 llvm-svn: 359039
* [OpenCL] Re-fix invalid address space generation for clk_event_t arguments ↵Alexey Sotkin2019-04-111-2/+2
| | | | | | | | | | | | | | | | | | | of enqueue_kernel builtin function Summary: https://reviews.llvm.org/D53809 fixed wrong address space(assert in debug build) generated for event_ret argument. But exactly the same problem exists for event_wait_list argument. This patch should fix both. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: kristina, ebevhan, cfe-commits Differential Revision: https://reviews.llvm.org/D59985 llvm-svn: 358151
* [AMDGPU] rename vi-insts into gfx8-instsStanislav Mekhanoshin2019-04-051-3/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D60293 llvm-svn: 357792
* AMDGPU: Add support for cross address space synchronization scopes (clang)Konstantin Zhuravlyov2019-03-251-10/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D59494 llvm-svn: 356947
* [OpenCL] Generate 'unroll.enable' metadata for ↵Andrew Savonichev2019-03-201-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | __attribute__((opencl_unroll_hint)) Summary: [OpenCL] Generate 'unroll.enable' metadata for __attribute__((opencl_unroll_hint)) For both !{!"llvm.loop.unroll.enable"} and !{!"llvm.loop.unroll.full"} the unroller will try to fully unroll a loop unless the trip count is not known at compile time. In that case for '.full' metadata no unrolling will be processed, while for '.enable' the loop will be partially unrolled with a heuristically chosen unroll factor. See: docs/LanguageExtensions.rst From https://www.khronos.org/registry/OpenCL/sdk/2.0/docs/man/xhtml/attributes-loopUnroll.html __attribute__((opencl_unroll_hint)) for (int i=0; i<2; i++) { ... } In the example above, the compiler will determine how much to unroll the loop. Before the patch for __attribute__((opencl_unroll_hint)) was generated metadata !{!"llvm.loop.unroll.full"}, which limits ability of loop unroller to decide, how much to unroll the loop. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: zzheng, dmgreen, jdoerfert, cfe-commits, asavonic, AlexeySotkin Tags: #clang Differential Revision: https://reviews.llvm.org/D59493 llvm-svn: 356571
* [AMDGPU] Add the missing clang change of the experimental buffer fat pointerMichael Liao2019-03-181-1/+1
| | | | llvm-svn: 356385
* AMDGPU: Fix the mapping of sub group sync scopeKonstantin Zhuravlyov2019-03-061-5/+5
| | | | | | | | Map memory_scope_sub_group to "wavefront" sync scope Differential Revision: https://reviews.llvm.org/D58847 llvm-svn: 355549
* [OpenCL] Fix assertion due to blocksYaxun Liu2019-02-261-0/+6
| | | | | | | | | | | | | | | | A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called. There is code Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle BlockExpr and returns nullptr, which causes isa to assert. This patch fixes that. Differential Revision: https://reviews.llvm.org/D58658 llvm-svn: 354893
* [OpenCL] Simplify LLVM IR generated for OpenCL blocksAndrew Savonichev2019-02-212-16/+28
| | | | | | | | | | | | | | | | | | | Summary: Emit direct call of block invoke functions when possible, i.e. in case the block is not passed as a function argument. Also doing some refactoring of `CodeGenFunction::EmitBlockCallExpr()` Reviewers: Anastasia, yaxunl, svenvh Reviewed By: Anastasia Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58388 llvm-svn: 354568
* [OpenCL] Change type of block pointer for OpenCLAlexey Bader2019-02-192-19/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For some reason OpenCL blocks in LLVM IR are represented as function pointers. These pointers do not point to any real function and never get called. Actually they point to some structure, which in turn contains pointer to the real block invoke function. This patch changes represntation of OpenCL blocks in LLVM IR from function pointers to pointers to `%struct.__block_literal_generic`. Such representation allows to avoid unnecessary bitcasts and simplifies further processing (e.g. translation to SPIR-V ) of the module for targets which do not support function pointers. Patch by: Alexey Sotkin. Reviewers: Anastasia, yaxunl, svenvh Reviewed By: Anastasia Subscribers: alexbatashev, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58277 llvm-svn: 354337
* [OpenCL][PR40707] Allow OpenCL C types in C++ mode.Anastasia Stulova2019-02-151-0/+1
| | | | | | Allow all OpenCL types to be parsed in C++ mode. llvm-svn: 354121
OpenPOWER on IntegriCloud