summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP/declare_target_codegen.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP] Add support for handling declare target to clause when unified ↵Gheorghe-Teodor Bercea2019-06-201-4/+4
| | | | | | | | | | | | | | | | | | | | | memory is required Summary: This patch adds support for the handling of the variables under the declare target to clause. The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63108 llvm-svn: 363959
* [OPENMP]Use the attributes for dso locality when building for device.Alexey Bataev2019-05-211-6/+6
| | | | | | | | | Currently, we ignore all dso locality attributes/info when building for the device and thus all symblos are externally visible and can be preemted at the runtime. It may lead to incorrect results. We need to follow the same logic, compiler uses for static/pie builds. llvm-svn: 361283
* [OPENMP]Allow to redefine entry for the variables definitions.Alexey Bataev2019-03-121-2/+14
| | | | | | | | | | | If the variable was declared and marked as declare target, a new offload entry with size 0 is created. But if later a definition is created and marked as declare target, this definition is not added to the entry set and the definition remains not mapped to the target. Patch fixes this problem allowing to redefine the size and linkage for previously registered declaration. llvm-svn: 355960
* [OPENMP]Fix emission of the target regions in virtual functions.Alexey Bataev2018-11-281-0/+24
| | | | | | | | Fixed emission of the target regions found in the virtual functions. Previously we may end up with the situation when those regions could be skipped. llvm-svn: 347793
* [OPENMP]Fix handling of the globals during compilation for the device.Alexey Bataev2018-11-071-2/+16
| | | | | | | | Fixed lookup for the target regions in unused virtual functions + fixed processing of the global variables not marked as declare target but emitted during debug info emission. llvm-svn: 346343
* Revert "[CodeGenCXX] Treat 'this' as noalias in constructors"Sean Fertile2018-10-151-1/+1
| | | | | | | This reverts commit https://reviews.llvm.org/rL344150 which causes MachineOutliner related failures on the ppc64le multistage buildbot. llvm-svn: 344526
* [CodeGenCXX] Treat 'this' as noalias in constructorsAnton Bikineev2018-10-101-1/+1
| | | | | | | | | This is currently a clang extension and a resolution of the defect report in the C++ Standard. Differential Revision: https://reviews.llvm.org/D46441 llvm-svn: 344150
* [OPENMP] Disable emission of the class with vptr if they are not used inAlexey Bataev2018-09-211-0/+10
| | | | | | | | | target constructs. Prevent compilation of the classes with the virtual tables when compiling for the device. llvm-svn: 342741
* [OPENMP] Fix PR38823: Do not emit vtable if it is not used in targetAlexey Bataev2018-09-061-2/+19
| | | | | | | | | | | context. If the explicit template instantiation definition defined outside of the target context, its vtable should not be marked as used. This is true for other situations where the compiler want to emit vtables unconditionally. llvm-svn: 341570
* [OPENMP] Fix PR38710: static functions are not emitted as implicitlyAlexey Bataev2018-08-301-1/+1
| | | | | | | | | 'declare target'. All the functions, referenced in implicit|explicit target regions must be emitted during code emission for the device. llvm-svn: 341093
* [OPENMP] Do not create offloading entry for declare target variablesAlexey Bataev2018-08-291-0/+4
| | | | | | | | | declarations. We should not create offloading entries for declare target var declarations as it causes compiler crash. llvm-svn: 340968
* [OPENMP] Fix crash on the emission of the weak function declaration.Alexey Bataev2018-08-201-0/+14
| | | | | | | | | If the function is actually a weak reference, it should not be marked as deferred definition as this is only a declaration. Patch adds checks for the definitions if they must be emitted. Otherwise, only declaration is emitted. llvm-svn: 340191
* [OPENMP] FIx processing of declare target variables.Alexey Bataev2018-08-151-3/+25
| | | | | | | | The compiler may produce unexpected error messages/crashes when declare target variables were used. Patch fixes problems with the declarations marked as declare target to or link. llvm-svn: 339805
* [OPENMP] Mark variables captured in declare target region as implicitlyAlexey Bataev2018-08-071-2/+17
| | | | | | | | | declare target. According to OpenMP 5.0, variables captured in lambdas in declare target regions must be considered as implicitly declare target. llvm-svn: 339152
* [OPENMP] Prevent problems with linking of the static variables.Alexey Bataev2018-07-311-4/+5
| | | | | | No need to change the linkage, we can avoid the problem using special variable. That points to the original variable and, thus, prevent some of the optimizations that might break the compilation. llvm-svn: 338399
* [OPENMP] Static variables on device must be externally visible.Alexey Bataev2018-07-271-2/+5
| | | | | | | Do not mark static variable as internal on the device as they must be visible from the host to be mapped correctly. llvm-svn: 338139
* [OPENMP] DO not crash on combined constructs in declare targetAlexey Bataev2018-05-161-1/+1
| | | | | | | | | | | functions. If the combined construct is specified in the declare target function and the device code is emitted, the compiler crashes because of the incorrectly chosen captured stmt. We should choose the innermost captured statement, not the outermost. llvm-svn: 332477
* [OPENMP] Mark global tors/dtors as used.Alexey Bataev2018-05-091-0/+4
| | | | | | | | | | | If the global variables are marked as declare target and they need ctors/dtors, these ctors/dtors are emitted and then invoked by the offloading runtime library. They are not explicitly used in the emitted code and thus can be optimized out. Patch marks these functions as used, so the optimizer cannot remove these function during the optimization phase. llvm-svn: 331879
* [OPENMP, NVPTX] Fix linkage of the global entries.Alexey Bataev2018-05-081-2/+2
| | | | | | | The linkage of the global entries must be weak to enable support of redefinition of the same target regions in multiple compilation units. llvm-svn: 331768
* [OPENMP] Support C++ member functions in the device constructs.Alexey Bataev2018-05-021-2/+13
| | | | | | | Added correct emission of the C++ member functions for the device function when they are used in the device constructs. llvm-svn: 331365
* [OPENMP] Emit template instatiation|specialization functions forAlexey Bataev2018-05-011-4/+8
| | | | | | | | | | devices. If the function is an instantiation|specialization of the template and is used in the device code, the definitions of such functions should be emitted for the device. llvm-svn: 331261
* [OPENMP] Do not crash on codegen for CXX member functions.Alexey Bataev2018-04-301-0/+6
| | | | | | | Non-static member functions should not be emitted as a standalone functions, this leads to compiler crash. llvm-svn: 331206
* [OPENMP] Allow to use declare target variables in map clausesAlexey Bataev2018-04-161-1/+1
| | | | | | | | Global variables marked as declare target are allowed to be used in map clauses. Patch fixes the crash of the compiler on the declare target variables in map clauses. llvm-svn: 330156
* [OPENMP] Codegen for `omp declare target` construct.Alexey Bataev2018-03-151-0/+66
Added initial codegen for device side of declarations inside `omp declare target` construct + codegen for implicit `declare target` functions, which are used in the target regions. llvm-svn: 327636
OpenPOWER on IntegriCloud