145 Commits

Author SHA1 Message Date
Valentin Clement
27f39ad499
[flang][openacc] Set structured to false for entry operation in declare ctor
Fix the value of the structured attribute for entry operation in the
global constructor noted in D156353.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156481
2023-07-28 09:48:14 -07:00
Valentin Clement
723e424e56
[flang][openacc][NFC] Remove unused variables 2023-07-27 14:06:18 -07:00
Valentin Clement
2a81925163
[flang][openacc][NFC] Move declare lowering for module in its own function 2023-07-27 14:03:32 -07:00
Valentin Clement
a2b92017d3
[flang][openacc] Lower acc declare link for module variable
This patch adds support to lower the link clause on OpenACC
declare construct in module declaration.

Depends on D156463

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156464
2023-07-27 13:04:00 -07:00
Valentin Clement
bbd214d997
[flang][openacc] Lower acc declare device_resident for module variable
This patch adds support to lower the device_resident clause on OpenACC
declare construct in module declaration.

Depends on D156457

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156463
2023-07-27 13:01:22 -07:00
Valentin Clement
5f2c585b10
[flang][openacc] Lower acc declare copyin for module variable
This patch adds support to lower the copyin clause on OpenACC
declare construct in module declaration.

Depends on D156353

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156457
2023-07-27 13:00:20 -07:00
Valentin Clement
e25d7f1688
[flang][openacc] Add global destructor for acc declare construct
Add the acc.global_dtor when lowering the OpenACC declare
construct.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156353
2023-07-27 12:59:01 -07:00
Valentin Clement
c217ff8794
[flang][openacc] Add basic lowering for OpenACC declare construct in module
This patch adds the skeleton and the basic lowering for OpenACC declare
construct when located in the module declaration. This patch just lower the
create clause with or without modifier. Other clause and global descrutor
lowering will come in follow up patches to keep this one small enough for
review.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D156266
2023-07-26 09:56:19 -07:00
Valentin Clement
be5ac66643
[flang][openacc] Keep original array size in reduction init region with slice
Keep the original array size when materializing the private copy.

Depends on D155882

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155893
2023-07-24 09:34:31 -07:00
Valentin Clement
9d8e4759a8
[flang][openacc] Update materialization recipe for private copy in reduction init region
Update the code generated in the init region to materialize the private
copy.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155882
2023-07-24 09:33:39 -07:00
Valentin Clement
d4f2416398
[flang][openacc] Fix hasDynamicShape logic
Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155897
2023-07-21 21:46:50 -07:00
Valentin Clement
a060102b3c
[flang][openacc] Support static slice in reduction lowering
Lower static array slices reduction with the correct
type.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155519
2023-07-18 14:14:10 -07:00
Valentin Clement
7f08f44962
[flang][openacc][NFC] Add test for scalar allocatable and pointer reduction
Add test for simple scalar allocatable or pointer. Set up the TODO
to be triggered when the allocatable or pointer are arrays.
Support for pointer/allocatable arrays will come next.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155230
2023-07-17 13:27:43 -07:00
Valentin Clement
d4a5470d8c
[flang][openacc] Add proper TODO for reduction with dynamic shaped array
Lowering for reduction with dynamic shaped arrays is not implemented yet.
Add a proper TODO for the time being.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155324
2023-07-17 13:03:36 -07:00
Valentin Clement
361beeeff0
[flang][openacc] Add extent when creating acc.bounds in genBaseBoundsOps
The extent information is available here so just add it to the acc.bounds
operation so it can be retrieved easily if needed.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155319
2023-07-14 12:56:58 -07:00
Valentin Clement
dd1a4bb0d4
[flang][openacc] Add support for complex mul reduction
Add support to lower reduction with the multiply operator and
complex type.

Depends on D155007

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155014
2023-07-13 11:18:20 -07:00
Valentin Clement
a25edba7b5
[flang][NFC] Remove duplicate of getDesignatorNameIfDataRef function
Remove duplicate of the getDesignatorNameIfDataRef() function.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D155105
2023-07-13 08:53:19 -07:00
Valentin Clement
119c512cb2
[flang][openacc] Add support for complex add reduction
Add lowering support for reduction with the add operator
on complex type.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155007
2023-07-12 14:28:22 -07:00
Valentin Clement
fb90d5f6c3
[flang][openacc] Support .neqv. reduction operator
Add support for the `.neqv.` reduction operator for
Flang/OpenACC lowering.

Depends on D154900

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154901
2023-07-12 13:27:02 -07:00
Valentin Clement
0e543747ab
[flang][openacc] Support .eqv. reduction operator
Add support for the `.eqv.` reduction operator for
Flang/OpenACC lowering.

Depends on D154898

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154900
2023-07-12 13:00:10 -07:00
Valentin Clement
464594dc2a
[flang][openacc] Support .or. reduction operator
Add support for the `.or.` reduction operator for
Flang/OpenACC lowering.

Depends on D154896

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154898
2023-07-12 12:58:22 -07:00
Valentin Clement
664575a9a9
[flang][openacc] Support .and. reduction operator
Add support for the `.and.` reduction operator
in Flang/OpenACC lowering.

Depends on D154888

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154896
2023-07-12 12:54:56 -07:00
Valentin Clement
a48445f1ec
[flang][openacc] Support array slices when creating firstprivate recipe
The return type of the recipe must match the array slice provided by
the user. This patch enhance the recipe creation to take into account
the constant slices.

Depends on D154657

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154727
2023-07-12 12:53:18 -07:00
Valentin Clement
67c8110fb3
[flang][openacc] Populate init and copy region of firstprivate recipe for simple type
Similiar to D154259 for private recipe, this patch makes use of the same code
for the init region of the firstprivate recipe and populate the copy region for
trivial types and arrays.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154657
2023-07-12 12:52:06 -07:00
Valentin Clement
aaf7a0fa26
[flang][openacc] Add error for unsupported min/max reduction on complex type
reduction operator min and max are not supported with complex type.
Add a proper error so it fails correctly.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D155016
2023-07-12 08:42:19 -07:00
Valentin Clement
425c574892
[flang][openacc] Support ieor reduction operator
Add support for `ieor` reduction operator in
OpenACC lowering.

Depends on D154887

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154888
2023-07-11 08:58:36 -07:00
Valentin Clement
0ec1acec78
[flang][openacc] Support ior reduction operator
Add support for `ior` reduction operator in
OpenACC lowering.

Depends on D154886

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154887
2023-07-11 08:56:12 -07:00
Valentin Clement
1aa22fe5ce
[flang][openacc] Support iand reduction operator
Add support for `iand` reduction operator in
OpenACC lowering.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154886
2023-07-11 08:50:48 -07:00
Valentin Clement
710874f68c
[flang][openacc][NFC] Fix type in assert message 2023-07-10 10:53:18 -07:00
Valentin Clement
897e69dd83
[flang][openacc] Support array slices when creating private recipe
The return type of the recipe must match the array slice provided by
the user. This patch enhance the recipe creation to take into account
the constant slices.

Depends on D154259

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154648
2023-07-06 14:08:18 -07:00
Valentin Clement
a05ed478c8
[flang][openacc] Populate the init region for acc.private.recipe for simple type
Generate code to allocate privates for trivial scalars and arrays.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154259
2023-07-06 13:55:54 -07:00
Valentin Clement
60bb4bafe2
[flang][NFC] Fix typos 2023-06-30 13:15:25 -07:00
Valentin Clement
32899e14af
[flang][openacc] Lower default clause to acc.data operation attributes
Lowering of the default clause was missing on the acc.data operation. This
patch lowers the default clause to its corresponding attribute.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154162
2023-06-30 11:21:48 -07:00
Valentin Clement
2faf397e4f
[flang][openacc] Lower async/wait clauses for acc.data
Lower async and wait clauses to the correponding
attributes and operands on the acc.data operation.

Depends on D154131

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154155
2023-06-30 11:12:33 -07:00
Valentin Clement
c9bfca5429
[flang][openacc] Lower the default clause on compute constructs
Lower default clause to the correct attribute for compute
operation.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154165
2023-06-30 10:24:46 -07:00
Valentin Clement
61807f5c29
[mlir][openacc] Add wait attribute and variadic operand
OpenACC 3.2 allowed the wait clause to the data construct. This patch
adds a unit attribute and a variadic operand to the data operation to model
the wait clause in a similar way it was added to other data operation.
The attribute models the presence of the clause without any argument. When
arguments are provided they are placed in the wait operand.

Depends on D154111

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154131
2023-06-30 10:04:49 -07:00
Valentin Clement
ecc7adc46c
[mlir][openacc] Add async attribute and optional operand
OpenACC 3.2 allowed the async clause to the data construct. This patch
adds a unit attribute and an optional operand to the data operation to model
the data clause in a similar way it was added to other data operation.
The attribute models the presence of the clause without any argument. When
an argument is provided it is placed in the async operand.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D154111
2023-06-30 10:03:48 -07:00
Valentin Clement
c88f3e209c
[flang][openacc] Update num_gangs parser
Update num_gangs definition in ACC.td and its lowering
to support up to 3 arguments.

Depends on D153796
Depends on D153801

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D153806
2023-06-27 11:10:38 -07:00
Valentin Clement
80ea480d6c
[flang][openacc] Support array reduction for max in lowering
Add loweirng support for array reduction with the
max operator. Simplify generation of init value.

Depends on D153661

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D153663
2023-06-26 12:03:11 -07:00
Valentin Clement
7d2d693cac
[flang][openacc] Support array reduction for min in lowering
Add loweirng support for array reduction with the
min operator.

Depends on D153650

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D153661
2023-06-26 09:20:11 -07:00
Valentin Clement
1b3d005ca9
[flang][openacc] Generate loop nest as column major
Address comment from D153455

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D153650
2023-06-26 08:37:45 -07:00
Valentin Clement
cd91f3a69b
[flang][mlir][openacc] Add acc.reduction operation as data entry operation
acc.reduction operation is used as data entry operation for the reduction
operands.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D153367
2023-06-23 10:27:07 -07:00
Valentin Clement
d5a50ed9bd
[flang][openacc] Add lowering support for multi-dimensional arrays reduction
Lower multi-dimensional arrays reduction for add and mul operator.

Depends on D153448

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D153455
2023-06-22 13:11:29 -07:00
Valentin Clement
ff86ce65f6
[flang][openacc] Add lowering support for 1d array reduction for add/mul operator
Lower 1d array reduction for add and mul operator. Multi-dimensional arrays and
other operator will follow.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D153448
2023-06-22 13:09:48 -07:00
Valentin Clement
7c9b9d316d
[flang][openacc] Use acc.private and acc.firstprivate when lowering clauses
Lower private and firstprivate operands through their corresponding
data entry operation to support array section.

Depends on D152972

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D152974
2023-06-21 14:19:55 -07:00
Valentin Clement
208fdcb07f
[flang][openacc] Add lowering for max operator
Add support for the max operator in the reduction
clause.

Depdns on D151671

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D151672
2023-06-14 15:21:23 -07:00
Valentin Clement
c1ca4d6fe7
[flang][openacc] Add lowering for min operator
Add lowering support for the min operator
in reduction clause.

Depends on D151565

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D151671
2023-06-14 08:18:03 -07:00
Valentin Clement
66546d94fc
[flang][openacc] Lower gang dim to MLIR
Lower gang dim from the parse tree to the new MLIR
representation.

Depends on D151972

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D151973
2023-06-13 23:20:41 -07:00
Valentin Clement
cf875caaa3
[flang][openacc][NFC] Remove unused genObjectList function
genObjectList is not used anymore. Just remove it.

Depends on D151975

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D151976
2023-06-13 20:44:22 -07:00
Valentin Clement
5923e46fce
[flang][openacc] Add parsing support for dim in gang clause
Add parsing supprot for dim in gang clause

Depends on D151971

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D151972
2023-06-13 20:33:36 -07:00