History log of /llvm-project-15.0.7/flang/lib/Lower/OpenMP.cpp (Results 1 – 25 of 71)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init
# f2b7f18e 26-Jul-2022 Shraiysh Vaishay <[email protected]>

Revert "[flang][OpenMP] Lowering support for default clause"

This reverts commit 05e6fce84fd39d150195b8928561f2c90c71e538.


# 05e6fce8 26-Jul-2022 Nimish Mishra <[email protected]>

[flang][OpenMP] Lowering support for default clause

This patch adds lowering support for default clause.

1. During symbol resolution in semantics, should the enclosing context have
a default data s

[flang][OpenMP] Lowering support for default clause

This patch adds lowering support for default clause.

1. During symbol resolution in semantics, should the enclosing context have
a default data sharing clause defined and a `parser::Name` is not attached
to an explicit data sharing clause, the
`semantics::Symbol::Flag::OmpPrivate` flag (in case of `default(private)`)
and `semantics::Symbol::Flag::OmpFirstprivate` flag (in case of
`default(firstprivate)`) is added to the symbol.

2. During lowering, all symbols having either
`semantics::Symbol::Flag::OmpPrivate` or
`semantics::Symbol::Flag::OmpFirstprivate` flag are collected and
privatised appropriately.

Co-authored-by: Peixin Qiao <[email protected]>

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D123930

show more ...


# 2aab797d 26-Jul-2022 Kazu Hirata <[email protected]>

[flang] Remove unused variable lastPrivBlock (NFC)

This fixes the warning:

llvm-project/flang/lib/Lower/OpenMP.cpp:94:10: error: unused
variable 'lastPrivBlock' [-Werror,-Wunused-variable]


# 17d9bdf4 26-Jul-2022 Arnamoy Bhattacharyya <[email protected]>

[Flang][OpenMP] Add support for lastprivate clause for worksharing loop.

This patch adds an initial support to the lastprivate clause for worksharing loop. The patch creates necessary control flow

[Flang][OpenMP] Add support for lastprivate clause for worksharing loop.

This patch adds an initial support to the lastprivate clause for worksharing loop. The patch creates necessary control flow to guarantee the store of the value from the logical last iteration of the workshare loop.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D130027

show more ...


# 7bb1151b 25-Jul-2022 Kiran Chandramohan <[email protected]>

[Flang][OpenMP] Initial support for integer reduction in worksharing-loop

Lower the Flang parse-tree containing OpenMP reductions to the OpenMP
dialect. The OpenMP dialect models reductions with,
1)

[Flang][OpenMP] Initial support for integer reduction in worksharing-loop

Lower the Flang parse-tree containing OpenMP reductions to the OpenMP
dialect. The OpenMP dialect models reductions with,
1) A reduction declaration operation that specifies how to initialize, combine,
and atomically combine private reduction variables.
2) The OpenMP operation (like wsloop) that supports reductions has an array of
reduction accumulator variables (operands) and an array attribute of the same
size that points to the reduction declaration to be used for the reduction
accumulation.
3) The OpenMP reduction operation that takes a value and an accumulator.
This operation replaces the original reduction operation in the source.

(1) is implemented by the `createReductionDecl` in OpenMP.cpp,
(2) is implemented while creating the OpenMP operation,
(3) is implemented by the `genOpenMPReduction` function in OpenMP.cpp, and
called from Bridge.cpp. The implementation of (3) is not very robust.

NOTE 1: The patch currently supports only reductions for integer type addition.
NOTE 2: Only supports reduction in the worksharing loop.
NOTE 3: Does not generate atomic combination region.
NOTE 4: Other options for creating the reduction operation include
a) having the reduction operation as a construct containing an assignment
and then handling it appropriately in the Bridge.
b) we can modify `genAssignment` or `genFIR(AssignmentStmt)` in the Bridge to
handle OpenMP reduction but so far we have tried not to mix OpenMP
and non-OpenMP code and this will break that.
I will try (b) in a separate patch.
NOTE 5: OpenMP dialect gained support for reduction with the patches:
D105358, D107343. See https://discourse.llvm.org/t/rfc-openmp-reduction-support/3367
for more details.

Reviewed By: awarzynski

Differential Revision: https://reviews.llvm.org/D130077

Co-authored-by: Peixin-Qiao <[email protected]>

show more ...


# 58753dea 16-Jul-2022 Nimish Mishra <[email protected]>

[flang][OpenMP] Fix warning due to uninitialized pointer dereference during atomic update lowering

Reviewed By: kiranchandramohan, kazu

Differential Revision: https://reviews.llvm.org/D129914


# a56b76d9 14-Jul-2022 Nimish Mishra <[email protected]>

[flang][OpenMP] Lowering support for atomic update construct

This patch adds lowering support for atomic update construct. A region
is associated with every `omp.atomic.update` operation wherein res

[flang][OpenMP] Lowering support for atomic update construct

This patch adds lowering support for atomic update construct. A region
is associated with every `omp.atomic.update` operation wherein resides:
(1) the evaluation of the expression on the RHS of the atomic assignment
statement, and (2) a `omp.yield` operation that yields the extended value
of expression evaluated in (1).

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D125668

show more ...


# 13019955 12-Jul-2022 Peixin Qiao <[email protected]>

[NFC][flang][OpenMP] Add comment for handling the data race problem in copyin clause

The reference and description is missed before.

Reviewed By: kiranchandramohan

Differential Revision: https://r

[NFC][flang][OpenMP] Add comment for handling the data race problem in copyin clause

The reference and description is missed before.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D129437

show more ...


# 2c915e3b 30-Jun-2022 Dominik Adamski <[email protected]>

[mlir][OpenMP] Add if clause to OpenMP simd construct

This patch adds if clause to OpenMP TableGen for simd construct.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D128940

[mlir][OpenMP] Add if clause to OpenMP simd construct

This patch adds if clause to OpenMP TableGen for simd construct.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D128940

Signed-off-by: Dominik Adamski <[email protected]>

show more ...


# 051dea82 29-Jun-2022 Kiran Chandramohan <[email protected]>

[Flang][OpenMP] Remove TODO for shared and two values of default clause

Shared is the default behaviour in the IR, so no handling is required.
Default clause with shared or none do not require any h

[Flang][OpenMP] Remove TODO for shared and two values of default clause

Shared is the default behaviour in the IR, so no handling is required.
Default clause with shared or none do not require any handling since
Shared is the default behaviour in the IR and None is only required
for semantic checks.

This patch is carved out from D123930 to remove couple of false TODOs.

Reviewed By: peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D128797

Co-authored-by: Nimish Mishra <[email protected]>

show more ...


# 1795f8cd 29-Jun-2022 Peixin-Qiao <[email protected]>

[NFC][OpenMP] Fix worksharing-loop

1. Remove the redundant collapse clause in MLIR OpenMP worksharing-loop
operation.
2. Fix several typos.
3. Refactor the chunk size type conversion since Create

[NFC][OpenMP] Fix worksharing-loop

1. Remove the redundant collapse clause in MLIR OpenMP worksharing-loop
operation.
2. Fix several typos.
3. Refactor the chunk size type conversion since CreateSExtOrTrunc has
both type check and type conversion.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128338

show more ...


# 794b3bf7 29-Jun-2022 Peixin-Qiao <[email protected]>

[NFC][flang] Add the missed `constexpr`

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D128598


# 27afb362 24-Jun-2022 Peixin-Qiao <[email protected]>

[flang][OpenMP] Initial support the lowering of copyin clause

This supports the lowering of copyin clause initially. The pointer,
allocatable, common block, polymorphic varaibles will be supported
l

[flang][OpenMP] Initial support the lowering of copyin clause

This supports the lowering of copyin clause initially. The pointer,
allocatable, common block, polymorphic varaibles will be supported
later.

This also includes the following changes:

1. Resolve the COPYIN clause and make the entity as host associated.

2. Fix collectSymbolSet by adding one option to control collecting the
symbol itself or ultimate symbol of it so that it can be used
explicitly differentiate the host and associated variables in
host-association.

3. Add one helper function `lookupOneLevelUpSymbol` to differentiate the
usage of host and associated variables explicitly. The previous
lowering of firstprivate depends on the order of
`createHostAssociateVarClone` and `lookupSymbol` of host symbol. With
this fix, this dependence is removed.

4. Reuse `copyHostAssociateVar` for copying operation of COPYIN clause.

Reviewed By: kiranchandramohan, NimishMishra

Differential Revision: https://reviews.llvm.org/D127468

show more ...


Revision tags: llvmorg-14.0.6
# c858f4db 20-Jun-2022 Shraiysh Vaishay <[email protected]>

[flang][OpenMP] Fix firstprivate with barrier

This patch fixes the unintentional data race in firstprivate
implementation. There is a Read-Write race when one thread tries
to copy the value inside t

[flang][OpenMP] Fix firstprivate with barrier

This patch fixes the unintentional data race in firstprivate
implementation. There is a Read-Write race when one thread tries
to copy the value inside the omp.parallel region while other
thread modifies it from inside the region (using pointers or
some other form of indirect access).

For detailed discussion please refer to [[ https://discourse.llvm.org/t/issues-with-the-current-implementation-of-privatization-in-openmp-with-fortran/62335 | discourse ]].

Reviewed By: kiranchandramohan, peixin, NimishMishra

Differential Revision: https://reviews.llvm.org/D125689

show more ...


# c030f467 13-Jun-2022 Kiran Chandramohan <[email protected]>

[Flang][OpenMP] Avoid double privatisation of loop variables

Loop variables of a worksharing loop and sequential loops in parallel
region are privatised by default. These variables are marked with
O

[Flang][OpenMP] Avoid double privatisation of loop variables

Loop variables of a worksharing loop and sequential loops in parallel
region are privatised by default. These variables are marked with
OmpPreDetermined. Skip explicit privatisation of these variables.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: Leporacanthicus

Differential Revision: https://reviews.llvm.org/D127249

Co-authored-by: Jean Perier <[email protected]>
Co-authored-by: Mats Petersson <[email protected]>

show more ...


# 3f4a63e5 13-Jun-2022 Arnamoy Bhattacharyya <[email protected]>

[Flang][OpenMP] Implementation of lowering of SIMD construct.

This patch adds code so that using bbc we are able to see an end-to-end lowering of simd construct in action.

Reviewed By: kiranchandra

[Flang][OpenMP] Implementation of lowering of SIMD construct.

This patch adds code so that using bbc we are able to see an end-to-end lowering of simd construct in action.

Reviewed By: kiranchandramohan, peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D125282

show more ...


Revision tags: llvmorg-14.0.5
# 5b66cc10 10-Jun-2022 Valentin Clement <[email protected]>

[flang][NFC] Move Todo.h from Lower to Optimizer

Remove a backwards dependence from Optimizer -> Lower by moving Todo.h
to the optimizer and out of lowering.

This patch is part of the upstreaming e

[flang][NFC] Move Todo.h from Lower to Optimizer

Remove a backwards dependence from Optimizer -> Lower by moving Todo.h
to the optimizer and out of lowering.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Eric Schweitz <[email protected]>

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D127292

show more ...


# 8b951e64 09-Jun-2022 Kiran Chandramohan <[email protected]>

[Flang][OpenMP] Lower schedule modifiers for worksharing loop

Add support for lowering the schedule modifiers (simd, monotonic,
non-monotonic) in worksharing loops.

Note: This is part of upstreamin

[Flang][OpenMP] Lower schedule modifiers for worksharing loop

Add support for lowering the schedule modifiers (simd, monotonic,
non-monotonic) in worksharing loops.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D127311

Co-authored-by: Mats Petersson <[email protected]>
Co-authored-by: Jean Perier <[email protected]>
Co-authored-by: Eric Schweitz <[email protected]>
Co-authored-by: V Donaldson <[email protected]>

show more ...


# bc99d565 08-Jun-2022 PeixinQiao <[email protected]>

[NFC][Flang][OpenMP] Refactor getting ompobject symbol

Getting ompobject symbol is needed in multiple places and will be
needed later for the lowering of other constructs/clauses such as
copyin clau

[NFC][Flang][OpenMP] Refactor getting ompobject symbol

Getting ompobject symbol is needed in multiple places and will be
needed later for the lowering of other constructs/clauses such as
copyin clause. Extract them into one function.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D127280

show more ...


# 411bd2d4 07-Jun-2022 Peixin-Qiao <[email protected]>

[flang][OpenMP] Support lowering parse-tree to MLIR for threadprivate directive

This supports lowering parse-tree to MLIR for threadprivate directive
following the OpenMP 5.1 [2.21.2] standard. Take

[flang][OpenMP] Support lowering parse-tree to MLIR for threadprivate directive

This supports lowering parse-tree to MLIR for threadprivate directive
following the OpenMP 5.1 [2.21.2] standard. Take the following as an
example:

```
program m
integer, save :: i
!$omp threadprivate(i)
call sub(i)
!$omp parallel
call sub(i)
!$omp end parallel
end
```
```
func.func @_QQmain() {
%0 = fir.address_of(@_QFEi) : !fir.ref<i32>
%1 = omp.threadprivate %0 : !fir.ref<i32> -> !fir.ref<i32>
fir.call @_QPsub(%1) : (!fir.ref<i32>) -> ()
omp.parallel {
%2 = omp.threadprivate %0 : !fir.ref<i32> -> !fir.ref<i32>
fir.call @_QPsub(%2) : (!fir.ref<i32>) -> ()
omp.terminator
}
return
}
```

A threadprivate operation (omp.threadprivate) is created for all
references to a threadprivate variable. The runtime will appropriately
return a threadprivate var (%1 as above) or its copy (%2 as above)
depending on whether it is outside or inside a parallel region. For
threadprivate access outside the parallel region, the threadprivate
operation is created in instantiateVar. Inside the parallel region, it
is created in createBodyOfOp.

One new utility function collectSymbolSet is created for collecting
all the variables with a property within a evaluation, which may be one
Fortran, or OpenMP, or OpenACC construct.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D124226

show more ...


Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3
# dc4bf2c3 17-Jan-2022 Mats Petersson <[email protected]>

[flang][OpenMP]Make omp.wsloop arguments appear in memory (#1277)

As per issue #1196, the loop induction variable, which is an argument
in the omp.wsloop operation, does not have a memory location,

[flang][OpenMP]Make omp.wsloop arguments appear in memory (#1277)

As per issue #1196, the loop induction variable, which is an argument
in the omp.wsloop operation, does not have a memory location, so when
passed to a function or subroutine, the reference to the value is not
a memory location, but the value of the induction variable. The callee
function/subroutine is then trying to dereference memory at address 1
or some other "not a good memory location".

This is fixed by creating a temporary memory location and storing the
value of the induction variable in that.

Test fixes as a consequence of the changed code generated.

Add checking for some of the omp-unstructured.f90 to check for alloca,
store and load operations, to ensure the correct flow. Add a test
for CYCLE inside a omp-do loop.

Also convert to use -emit-fir in the omp-unstructrued, and make
the symbol matching consistent in the omp-wsloop-variable test.

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D126711

show more ...


# b501503c 31-May-2022 kiranchandramohan <[email protected]>

[Flang][OpenMP] Fix for unstructured regions in OpenMP constructs - 2

The following changes are made for OpenMP operations with unstructured region,
1. For combined constructs the outer operation is

[Flang][OpenMP] Fix for unstructured regions in OpenMP constructs - 2

The following changes are made for OpenMP operations with unstructured region,
1. For combined constructs the outer operation is considered a structured
region and the inner one as the unstructured.
2. Added a condition to ensure that we create new blocks only once for nested
unstructured OpenMP constructs.

Tests are added for checking the structure of the CFG.

Note: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project. Code originally reviewed
at https://github.com/flang-compiler/f18-llvm-project/pull/1394.

Reviewed By: vdonaldson, shraiysh, peixin

Differential Revision: https://reviews.llvm.org/D126375

show more ...


Revision tags: llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4
# 820146ab 22-Mar-2021 Mats Petersson <[email protected]>

[OpenMP] Pass chunk-size to MLIR while lowering from parse-tree

Test that chunk size is passed to the static init function.
Using three different variations:
1. Single constant.
2. Expression with c

[OpenMP] Pass chunk-size to MLIR while lowering from parse-tree

Test that chunk size is passed to the static init function.
Using three different variations:
1. Single constant.
2. Expression with constants.
3. Variable value.

Reviewed By: peixin, shraiysh

Differential Revision: https://reviews.llvm.org/D126383

show more ...


# 66073306 28-May-2022 Peixin-Qiao <[email protected]>

[flang][OpenMP] Fix pointer variables in atomic read/write

For pointer variables, using getSymbolAddress cannot get the coorect
address for atomic read/write operands. Use genExprAddr to fix it.

Re

[flang][OpenMP] Fix pointer variables in atomic read/write

For pointer variables, using getSymbolAddress cannot get the coorect
address for atomic read/write operands. Use genExprAddr to fix it.

Reviewed By: shraiysh, NimishMishra

Differential Revision: https://reviews.llvm.org/D125793

show more ...


# 29f167ab 24-May-2022 Kiran Chandramohan <[email protected]>

[Flang][OpenMP] Fixes for unstructured OpenMP code

Since the FIR operations are mostly structured, it is only the functions
that could contain multiple blocks inside an operation. This changes
with

[Flang][OpenMP] Fixes for unstructured OpenMP code

Since the FIR operations are mostly structured, it is only the functions
that could contain multiple blocks inside an operation. This changes
with OpenMP since OpenMP regions can contain multiple blocks. For
unstructured code, the blocks are created in advance and belong to the
top-level function. This caused code in OpenMP region to be placed under
the function level.

In this fix, if the OpenMP region is unstructured then new blocks are
created inside it.

Note1: This is part of upstreaming from the fir-dev branch of
https://github.com/flang-compiler/f18-llvm-project. The code in this patch is a
subset of the changes in https://github.com/flang-compiler/f18-llvm-project/pull/1178.

Reviewed By: vdonaldson

Differential Revision: https://reviews.llvm.org/D126293

Co-authored-by: Val Donaldson <[email protected]>
Co-authored-by: Eric Schweitz <[email protected]>
Co-authored-by: Valentin Clement <[email protected]>

show more ...


123