summaryrefslogtreecommitdiffstats
path: root/test/OpenMP/for_codegen.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Fix PR35156: Get correct thread id with windows exceptions.Alexey Bataev2017-11-021-1/+1
| | | | | | | If the thread id is requested in windows mode within funclets, we may generate incorrect function call that could lead to broken codegen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317208 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-09-061-3/+3
| | | | | | | | | | | | __kmpc_for_static_fini(). Added special flags for calls of __kmpc_for_static_fini(), like previous ly for __kmpc_for_static_init(). Added flag OMP_IDENT_WORK_DISTRIBUTE for distribute cnstruct, OMP_IDENT_WORK_SECTIONS for sections-based constructs and OMP_IDENT_WORK_LOOP for loop-based constructs in location flags. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312642 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix the test, NFC.Alexey Bataev2017-08-311-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312296 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR34398: assert with random access iterator if theAlexey Bataev2017-08-311-0/+12
| | | | | | | | | | | | step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312292 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.Alexey Bataev2017-08-161-1/+1
| | | | | | | | | | | If exceptions are enabled, there may be a problem with the codegen of the finalization functions from OpenMP runtime. It happens because of the problem with the getting of thread identifier value. Patch tries to fix it by using the result of the call of function __kmpc_global_thread_num() rather than loading of value of outlined function parameter. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@311007 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-08-141-3/+4
| | | | | | | | | | | | | __kmpc_for_static_init(). OpenMP 5.0 will include OpenMP Tools interface that requires distinguishing different worksharing constructs. Since the same entry point (__kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,........)) is called in case static loop/sections/distribute it is suggested using 'flags' field of the ident_t structure to pass the type of the construct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@310865 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for PR31416: Clang crashes on OMPCapturedExpr during sourceAlexey Bataev2016-12-201-0/+3
| | | | | | | | | based coverage compilation Added source location info to captured expression declaration + fixed source location info for loop based directives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290181 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary x86 backend requirements from OpenMP testsReid Kleckner2016-10-211-1/+0
| | | | | | Clang can generate LLVM IR for x86 without a registered x86 backend. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284836 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix crash for 'schedule|dist_schedule' clauses duringAlexey Bataev2016-06-151-0/+21
| | | | | | | | | | instantiation. Added checks for non-dependent context when trygin to capture non-constant schedule chunk expression for proper codegen of outlined functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@272775 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.5] Add codegen support in runtime for '[non]monotonic'Alexey Bataev2016-05-101-4/+4
| | | | | | | | | | schedule modifiers. Runtime library expects some additional data in schedule argument for loop-based directives, that have additional schedule modifiers 'monotonic|nonmonotonic'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@269035 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Remove extra code transformation.Alexey Bataev2016-03-291-1/+2
| | | | | | | | | For better support of some specific GNU extensions some extra transformation of AST nodes were introduced. These transformations are very hard to handle. The code is improved in handling of these extensions by using captured expressions construct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@264709 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop messing with the 'g' group of options in CompilerInvocation.Douglas Katzman2015-10-081-1/+1
| | | | | | | | | | | | | | | | With this change, most 'g' options are rejected by CompilerInvocation. They remain only as Driver options. The new way to request debug info from cc1 is with "-debug-info-kind={line-tables-only|limited|standalone}" and "-dwarf-version={2|3|4}". In the absence of a command-line option to specify Dwarf version, the Toolchain decides it, rather than placing Toolchain-specific logic in CompilerInvocation. Also fix a bug in the Windows compatibility argument parsing in which the "rightmost argument wins" principle failed. Differential Revision: http://reviews.llvm.org/D13221 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249655 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only ↵Alexey Bataev2015-09-151-1/+1
| | | | | | | | | | | | | | | if 'cancel' is found. Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then ``` if (__kmpc_cancel_barrier()) exit from outer construct; ``` code is generated. Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247681 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.1] Allow variables with reference types in private clauses.Alexey Bataev2015-08-181-0/+4
| | | | | | | OpenMP 4.1 allows to use variables with reference types in all private clauses (private, firstprivate, lastprivate, linear etc.). Patch allows to use such variables and fixes codegen for linear variables with reference types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245268 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix for http://llvm.org/PR24371: Assert failure compiling blender 2.75.Alexey Bataev2015-08-141-8/+13
| | | | | | | | blender uses statements expression in condition of the loop under control of the '#pragma omp parallel for'. This condition is used several times in different expressions required for codegen of the loop directive. If there are some variables defined in statement expression, it fires an assert during codegen because of redefinition of the same variables. We have to rebuild several expression to be sure that all variables are unique. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245041 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.1] Allow references in init expression for loop-based constructs.Alexey Bataev2015-08-061-0/+15
| | | | | | | OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244209 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fixed detection of canonical loops with random access iterators.Alexey Bataev2015-07-161-2/+3
| | | | | | | Add handling of iterators with copy/move constructors with default arguments + converting template constructors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242382 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] http://llvm.org/PR24121: canonical loop rejected when comparison ↵Alexey Bataev2015-07-151-1/+56
| | | | | | | | | has implicit conversions or destruction Allow to use complex iterators expressions in loops for C++. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242285 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert r241620 and follow-up commits" and move the initializationAdrian Prantl2015-07-081-1/+1
| | | | | | of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241653 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r241620 and follow-up commits while investigating linux buildbot ↵Adrian Prantl2015-07-071-1/+1
| | | | | | failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241642 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang modules and pch files in an object file container.Adrian Prantl2015-07-071-1/+1
| | | | | | | | | | | | | This patch adds ObjectFilePCHContainerOperations uses the LLVM backend to put the contents of a PCH into a __clangast section inside a COFF, ELF, or Mach-O object file container. This is done to facilitate module debugging by makeing it possible to store the debug info for the types defined by a module alongside the AST. rdar://problem/20091852 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241620 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP 4.0] Fixed codegen for 'cancellation point' construct.Alexey Bataev2015-07-031-7/+7
| | | | | | | | | | | Generate the next code for 'cancellation point': if (__kmpc_cancellationpoint()) { __kmpc_cancel_barrier(); <exit construct>; } git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241336 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)Alexey Bataev2015-05-201-4/+4
| | | | | | | | -fopenmp turns on OpenMP support and links libiomp5 as OpenMP library. Also there is -fopenmp={libiomp5|libgomp} option that allows to override effect of -fopenmp and link libgomp library (if -fopenmp=libgomp is specified). Differential Revision: http://reviews.llvm.org/D9736 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@237769 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Generate !llvm.mem.loop_parallel_access metadata for loops with ↵Alexey Bataev2015-05-071-2/+7
| | | | | | | | | | | dynamic/guided scheduling. Inner bodies of OpenMP worksharing loop-based constructs with dynamic or guided scheduling are allowed to be marked with !llvm.mem.parallel_loop_access metadata for better optimization. Worksharing constructs with static scheduling cannot be marked this way (according to OpenMP standard "A data dependence between the same logical iterations in two such loops is guaranteed"). Constructs with auto and runtime scheduling are also not marked because automatically chosen scheduling may be static also. Differential Revision: http://reviews.llvm.org/D9518 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236693 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Allow to use global variables as lcv in loop-based directives.Alexey Bataev2015-04-301-1/+41
| | | | | | | | For proper codegen we need to capture variable in the OpenMP region. In loop-based directives loop control variables are private by default and they must be captured in this region. There was a problem with capturing of globals, used as lcv, as they was not marked as private by default. Differential Revision: http://reviews.llvm.org/D9336 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236201 91177308-0d34-0410-b5e6-96231b3b80d8
* DebugInfo: Metadata constructs now start with DI*Duncan P. N. Exon Smith2015-04-291-3/+3
| | | | | | | | | | LLVM r236120 renamed debug info IR constructs to use a `DI` prefix, now that the `DIDescriptor` hierarchy has been gone for about a week. This commit was generated using the rename-md-di-nodes.sh upgrade script attached to PR23080, followed by running clang-format-diff.py on the `lib/` portion of the patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236121 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fix use of unsigned counters in loops with zero trip count.Alexey Bataev2015-04-221-0/+25
| | | | | | | | | Patch fixes bugs in codegen for loops with unsigned counters and zero trip count. Previously preconditions for all loops were built using logic (Upper - Lower) > 0. But if the loop is a loop with zero trip count, then Upper - Lower is < 0 only for signed integer, for unsigned we're running into an underflow situation. In this patch we're using original Lower<Upper condition to check that loop body can be executed at least once. Also this allows to skip code generation for loops, if it is known that preconditions for the loop are always false. Differential Revision: http://reviews.llvm.org/D9103 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235500 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Improved codegen for implicit/explicit 'barrier' constructs.Alexey Bataev2015-03-301-8/+9
| | | | | | | | Replace boolean IsExplicit parameter of OpenMPRuntime::emitBarrierCall() method by OpenMPDirectiveKind Kind for better compatibility with the runtime library. Also add processing of 'nowait' clause on worksharing directives. Differential Revision: http://reviews.llvm.org/D8659 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233511 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] CodeGen - 'omp for' with dynamic schedule kinds.Alexander Musman2015-03-121-3/+172
| | | | | | | | Differential Revision: http://reviews.llvm.org/D7138 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@232036 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fixed tests for non-debug builds. NFC.Alexey Bataev2015-03-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231758 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Improved code for generating debug info + generation of all OpenMP ↵Alexey Bataev2015-03-101-4/+20
| | | | | | | | | | regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231757 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[OPENMP] Improved code for generating debug info + generation of all ↵Rafael Espindola2015-03-101-20/+4
| | | | | | | | | | | | | OpenMP regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935" This reverts commit r231752. It was failing to link with cmake: lib64/libclangCodeGen.a(CGOpenMPRuntime.cpp.o):/home/espindola/llvm/llvm/tools/clang/lib/CodeGen/CGOpenMPRuntime.cpp:function clang::CodeGen::InlinedOpenMPRegionRAII::~InlinedOpenMPRegionRAII(): error: undefined reference to 'clang::CodeGen::EHScopeStack::popTerminate()' clang-3.7: error: linker command failed with exit code 1 (use -v to see invocation) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231754 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Improved code for generating debug info + generation of all OpenMP ↵Alexey Bataev2015-03-101-4/+20
| | | | | | | | | | regions in termination scope Patch adds proper generation of debug info for all OpenMP regions. Also, all OpenMP regions are generated in a termination scope, because standard does not allow to throw exceptions out of structured blocks, associated with the OpenMP regions Differential Revision: http://reviews.llvm.org/D7935 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@231752 91177308-0d34-0410-b5e6-96231b3b80d8
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-24/+24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230795 91177308-0d34-0410-b5e6-96231b3b80d8
* [OPENMP] Fixed codegen for directives without function outlining.Alexey Bataev2015-02-261-0/+8
| | | | | | | Fixed crash on codegen for directives like 'omp for', 'omp single' etc. inside of the 'omp parallel', 'omp task' etc. regions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230621 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Wrap clang module files in a Mach-O, ELF, or COFF container."Adrian Prantl2015-02-251-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230454 91177308-0d34-0410-b5e6-96231b3b80d8
* Wrap clang module files in a Mach-O, ELF, or COFF container.Adrian Prantl2015-02-251-1/+1
| | | | | | | | | | | | | | | | | This is a necessary prerequisite for debugging with modules. The .pcm files become containers that hold the serialized AST which allows us to store debug information in the module file that can be shared by all object files that were built importing the module. This reapplies r230044 with a fixed configure+make build and updated dependencies and testcase requirements. Over the last iteration this version adds - missing target requirements for testcases that specify an x86 triple, - a missing clangCodeGen.a dependency to libClang.a in the make build. rdar://problem/19104245 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@230423 91177308-0d34-0410-b5e6-96231b3b80d8
* Support ‘omp for’ with static chunked schedule kind.Alexander Musman2015-01-221-1/+60
| | | | | | | | Differential Revision: http://reviews.llvm.org/D7006 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226795 91177308-0d34-0410-b5e6-96231b3b80d8
* Test for 'omp for' (for r224233).Alexander Musman2014-12-151-0/+91
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224234 91177308-0d34-0410-b5e6-96231b3b80d8