Commit Graph

15 Commits

Author SHA1 Message Date
Kelvin Li efbe4afbda [OPENMP] Support relational-op != (not-equal) as one of the canonical
forms of random access iterator
    
In OpenMP 4.5, only 4 relational operators are supported: <, <=, >, 
and >=.  This work is to enable support for relational operator 
!= (not-equal) as one of the canonical forms.

Patch by Anh Tuyen Tran
    
Differential Revision: https://reviews.llvm.org/D54441

llvm-svn: 347405
2018-11-21 19:10:48 +00:00
Alexey Bataev a8a9153a37 [OPENMP] Support for -fopenmp-simd option with compilation of simd loops
only.

Added support for -fopenmp-simd option that allows compilation of
simd-based constructs without emission of OpenMP runtime calls.

llvm-svn: 321560
2017-12-29 18:07:07 +00:00
Alexey Bataev 5372fb8cc1 [OPENMP] Fix for PR34398: assert with random access iterator if the
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.

llvm-svn: 312292
2017-08-31 23:06:52 +00:00
Alexey Bataev 5a3af13d93 [OPENMP] Remove extra code transformation.
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.

llvm-svn: 264709
2016-03-29 08:58:54 +00:00
Alexey Bataev 113438cd5c [OPENMP 4.5] Allow 'ordered' clause on 'loop simd' constructs.
OpenMP 4.5 allows to use 'ordered' clause without parameter on 'loop simd' constructs.

llvm-svn: 256639
2015-12-30 12:06:23 +00:00
Alexey Bataev e648e80fbf [OPENMP] Do not allow to use threadprivate or thread local variables as loop iteration variables.
According to OpenMP the loop iteration variable may not appear in a threadprivate directive.

llvm-svn: 256417
2015-12-25 13:38:08 +00:00
Alexey Bataev b08f89ffc1 [OPENMP] Fix for http://llvm.org/PR24371: Assert failure compiling blender 2.75.
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.

llvm-svn: 245041
2015-08-14 12:25:37 +00:00
Alexey Bataev a889917493 [OPENMP 4.1] Allow references in init expression for loop-based constructs.
OpenMP 4.1 allows to use variables with reference types in private clauses and, therefore, in init expressions of the cannonical loop forms.

llvm-svn: 244209
2015-08-06 12:30:57 +00:00
Alexey Bataev 0d08a7ffba [OPENMP] Fixed detection of canonical loops with random access iterators.
Add handling of iterators with copy/move constructors with default arguments + converting template constructors.

llvm-svn: 242382
2015-07-16 04:19:43 +00:00
Alexey Bataev db39021cee [OPENMP] -fopenmp enables OpenMP support (fix for http://llvm.org/PR23492)
-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

llvm-svn: 237769
2015-05-20 04:24:19 +00:00
Alexey Bataev 0c024df9d1 [OPENMP] Allow using of threadprivate variables as loop-control variables in lop based directives.
llvm-svn: 237102
2015-05-12 09:02:07 +00:00
Alexey Bataev 9c82103743 [OPENMP] Allow to use global variables as lcv in loop-based directives.
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

llvm-svn: 236201
2015-04-30 04:23:23 +00:00
Alexey Bataev 9aba41c822 [OPENMP] Temporary fix for processing of global variables in loops.
Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted.

llvm-svn: 221970
2014-11-14 04:08:45 +00:00
Alexander Musman a5f070aec0 [OPENMP] Loop collapsing and codegen for 'omp simd' directive.
This patch implements collapsing of the loops (in particular, in
presense of clause 'collapse'). It calculates number of iterations N
and expressions nesessary to calculate the nested loops counters
values based on new iteration variable (that goes from 0 to N-1)
in Sema. It also adds Codegen for 'omp simd', which uses
(and tests) this feature.

Differential Revision: http://reviews.llvm.org/D5184

llvm-svn: 218743
2014-10-01 06:03:56 +00:00
Alexander Musman e4e893bb36 [OPENMP] Parsing/Sema of directive omp parallel for simd
llvm-svn: 218299
2014-09-23 09:33:00 +00:00