Commit Graph

8 Commits

Author SHA1 Message Date
Alexey Bataev be99c61588 [OPENMP50]Codegen for iterator construct.
Implemented codegen for the iterator expression in the depend clauses.
Iterator construct is emitted the following way:
iterator(cnt1, cnt2, ...), in : <dep>

<TotalNumDeps> = <cnt1_size> * <cnt2_size> * ...;
kmp_depend_t deps[<TotalNumDeps>];
deps_counter = 0;
for (cnt1) {
  for (cnt2) {
    ...
    deps[deps_counter].base_addr = &<dep>;
    deps[deps_counter].size = sizeof(<dep>);
    deps[deps_counter].flags = in;
    deps_counter += 1;
    ...
  }
}

For depobj construct the codegen is very similar, but the memory is
allocated dynamically and added extra first item reserved for internal use.
2020-04-07 15:26:00 -04:00
Alexey Bataev e094dd5adc [OPENMP50]Fix size calculation for array shaping expression in the
codegen.

Need to include the size of the pointee type when trying to calculate
the total size of the array shaping expression.
2020-03-31 18:45:21 -04:00
Alexey Bataev 7842e7ebbf [OPENMP50]Add codegen support for array shaping expression in depend
clauses.

Implemented codegen for array shaping operation in depend clauses. The
begin of the expression is the pointer itself, while the size of the
dependence data is the mukltiplacation of all dimensions in the array
shaping expression.
2020-03-30 13:37:21 -04:00
Alexey Bataev 5dadf577d5 [OPENMP50]Add 'depobj' modifier in 'depend' clauses.
Added basic support (parsing/sema/serialization) for depobj dependency
kind in depend clauses.
2020-03-06 11:44:57 -05:00
Alexey Bataev 8d7b118875 [OPENMP50]Add codegen for update clause in depobj directive.
Added codegen for update clause in depobj. Reads the number of the
elements from the first element and updates flags for each element in
the loop.
```
omp_depend_t x;
kmp_depend_info *base = (kmp_depend_info *)x;
intptr_t num = x[-1].base_addr;
kmp_depend_info *end = x + num;
kmp_depend_info *el = base;
do {
  el.flags = new_flag;
  el = &el[1];
} while (el != end);
```
2020-03-05 14:31:07 -05:00
Alexey Bataev ea5b3ef593 [OPENMP50]Skip the first element when storing the list of dependencies
in depobj object.

The first element in the list of the dependencies is used for internal
purposes to store the number of the elements in the provided list.
The first element now is skipped and depobj object poits exactly to the
list of dependencies.
2020-03-05 14:26:07 -05:00
Alexey Bataev b27ff4d07d [OPENMP50]Codegen for 'destroy' clause in depobj directive.
If the destroy clause is appplied, the previously allocated memory for
the dependency object must be destroyed.
2020-03-04 16:30:34 -05:00
Alexey Bataev e46f0fee30 [OPENMP50]Codegen for 'depend' clause in depobj directive.
Added codegen for 'depend' clause in depobj directive. The depend clause
is emitted as kmp_depend_info <deps>[<number_of_items_in_clause> + 1]. The
first element in this array is reserved for storing the number of
elements in this array: <deps>[0].base_addr =
<number_of_items_in_clause>;

This extra element is required to implement 'update' and 'destroy'
clauses. It is required to know the size of array to destroy it
correctly and to update depency kind.
2020-03-04 15:01:53 -05:00