This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Implement hlfir.forall codegen when no temp is required
ClosedPublic

Authored by jeanPerier on May 15 2023, 6:00 AM.

Details

Summary

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.

Depends on D150455

Diff Detail

Event Timeline

jeanPerier created this revision.May 15 2023, 6:00 AM
jeanPerier requested review of this revision.May 15 2023, 6:00 AM
clementval accepted this revision.May 15 2023, 9:14 AM

LGTM

flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
312
This revision is now accepted and ready to land.May 15 2023, 9:14 AM
tschuett added inline comments.
flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
46

generates?

83

no const?

86

no const?

jeanPerier marked 4 inline comments as done.May 16 2023, 2:00 AM

Thanks for the reviews

flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
46

Thanks

83

Thanks, the ref is actually no needed. MLIR values/operations should be passed by value. However, added it the method.

jeanPerier marked 2 inline comments as done.
  • Fix typo in comments.
  • Make mustSavedRegionIn and isRequiredInCurrentRun const methods.
  • Rebase.
tblah accepted this revision.May 17 2023, 3:34 AM

LGTM, thanks.

This revision was landed with ongoing or failed builds.May 19 2023, 6:56 AM
This revision was automatically updated to reflect the committed changes.