[flang][hlfir] Implement hlfir.forall codegen when no temp is required
authorJean Perier <jperier@nvidia.com>
Fri, 19 May 2023 08:24:25 +0000 (10:24 +0200)
committerJean Perier <jperier@nvidia.com>
Fri, 19 May 2023 13:55:40 +0000 (15:55 +0200)
commitc9e3840c832d4c3fbbf57f0a8c90ae3d80af8913
treeb6998388f61ea0f867e9d5a35048cd61bbb403bd
parent8288d39b4cce67a3947204aa955df082ad0e76fc
[flang][hlfir] Implement hlfir.forall codegen when no temp is required

The patch applies the schedule built with the utility added in the
previous D150455 patch to generate the code for an ordered assignment
tree. For now, it only supports forall that do not contain user defined
assignments or assignments to vector subscripted entities, and for
which the scheduling analysis does not require temporary storages.

Support for temporary, WHERE, and user-defined/vector subscript
assignment will be added in later patches.

This enables end-to-end support with HLFIR for forall where the schedule
analysis can prove there is no need to create temporary storage.

Differential Revision: https://reviews.llvm.org/D150564
flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
flang/test/HLFIR/order_assignments/forall-codegen-fuse-assignments.fir [new file with mode: 0644]
flang/test/HLFIR/order_assignments/forall-codegen-no-conflict.fir [new file with mode: 0644]
flang/test/HLFIR/ordered-assignments-codegen-todo.fir