131 Commits

Author SHA1 Message Date
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
Valentin Clement
e6d8598e13
[mlir][flang][openacc] Use new firstprivate representation for compute construct
Use the new firstprivate representation on the comupte construct.

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D151975
2023-06-13 20:32:23 -07:00
Valentin Clement
7f3d2cc26b
[mlir][openacc] Add gang dim operand to acc.loop operation
OpenACC 3.3 introduces a dim argument on the gang clause. This patch
adds a new operand for it on the acc.loop and update the custom
gang clause parser/printer for it.

Depends on D151970

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D151971
2023-06-13 13:39:29 -07:00
Valentin Clement
ae86fe8591
[flang][openacc] Add parser support for the force modifier in the collapse clause
This patch adds parser support for the force modifier on the collapse clause
introduced in OpenACC 3.3.
Lowering will currently hit a TODO as the MLIR representation of the acc.loop
might need some update.

Reviewed By: kiranchandramohan

Differential Revision: https://reviews.llvm.org/D151974
2023-06-12 11:01:59 -07:00
Razvan Lupusoru
5e3faa05a0 [flang][openacc] Lower reduction for compute constructs
Parallel and serial constructs support reduction clause. Extend
recent D151564 loop reduction clause support to also include these
compute constructs.

Reviewed By: clementval, vzakhari

Differential Revision: https://reviews.llvm.org/D151955
2023-06-07 13:44:25 -07:00
Valentin Clement
e939dbc314
[flang][openacc] Add lowering for multiply operator
Add support for the * operation in OpenACC lowering. Support is added
for the types currently supported.

Depends on D151564

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D151565
2023-06-01 22:17:04 +09:00
Valentin Clement
59ceb7dd9a
[flang][openacc] Initial reduction clause lowering
Add initial support to lower reduction clause to its representation in MLIR.

This patch adds support for addition of integer and real scalar types. Other
operators and types will be added with follow up patches.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D151564
2023-06-01 22:15:28 +09:00
Valentin Clement
b4b9ed75d3
[flang][openacc][NFC] Remove unused function
Now that operands have moved to the new data operands lowering, this
function is not used anymore.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D151357
2023-05-24 14:00:46 -07:00
Valentin Clement
99e880b672
[flang][openacc][NFC] Add API to create acc.private.recipe from FIR type
Simply make the creation of acc.private.recipe accesible through an API.
This will be useful when we will implement passes like the implicit
privatization.

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D151230
2023-05-23 15:08:44 -07:00
Valentin Clement
d2fddaef53
[mlir][flang][openacc] Use new private representation for acc.loop
Update acc.loop private operands list to use the new design
introduced in D150622.

Depends on D150975

Reviewed By: razvanlupusoru

Differential Revision: https://reviews.llvm.org/D150984
2023-05-22 09:52:43 -07:00
Valentin Clement
580c31f446
[flang][openacc] Add initial support to lower private clause to the new design
This patch adds the initial infrastructure to lower the private clause to the
new design introduced in D150622. The init region is not implemented yet
and currently only yield the input argument (semantic is then similar with the previous
design currently). Implementation will come in a follow up patch to keep patch.

This patch also re-enable test commented out for `acc serial`, `acc serial loop`,
`acc parallel` and `acc parallel loop` with private clause.

Depends on D150972, D150973

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D150975
2023-05-22 09:52:11 -07:00
Valentin Clement
38423349ce
[flang][openacc] Lower host_data construct
Lower host_data construct to the acc.host_data operation.

Depends on D150289

Reviewed By: razvanlupusoru, jeanPerier

Differential Revision: https://reviews.llvm.org/D150290
2023-05-15 11:22:39 -07:00
Valentin Clement
1e463942f4
[mlir][openacc] Cleanup acc.kernels from old data clause operands
Remove old clause operands from acc.kernels operation since
the new dataOperands is now in place.
private and firstprivate will receive some redesign but are
not part of the new dataOperands.

Depends on D150224

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D150225
2023-05-10 08:38:03 -07:00
Valentin Clement
3484745a5f
[mlir][openacc] Cleanup acc.serial from old data clause operands
Remove old clause operands from acc.serial operation since
the new dataOperands is now in place.
private and firstprivate will receive some redesign but are
not part of the new dataOperands.

Depends on D150207

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D150224
2023-05-10 08:34:25 -07:00
Valentin Clement
b60e49165e
[flang][openacc] Preserve user order for entry data operand on compute construct
The order of operand in clauses that are decomposed was not
preserved. This patch change how operands are handled and preserve
the user ordering for the entry data operation on the acc.parallel
operation.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D150214
2023-05-10 08:31:53 -07:00