This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Add lowering support for multi-dimensional arrays reduction
ClosedPublic

Authored by clementval on Jun 21 2023, 12:00 PM.

Details

Summary

Lower multi-dimensional arrays reduction for add and mul operator.

Depends on D153448

Diff Detail

Event Timeline

clementval created this revision.Jun 21 2023, 12:00 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 21 2023, 12:00 PM
clementval requested review of this revision.Jun 21 2023, 12:00 PM
razvanlupusoru accepted this revision.Jun 21 2023, 9:24 PM

Looks great also!

This revision is now accepted and ready to land.Jun 21 2023, 9:24 PM
jeanPerier added inline comments.Jun 23 2023, 12:41 AM
flang/test/Lower/OpenACC/acc-reduction.f90
128–136

Probably not a correctness issue, but the loop nest is reversed from a memory access point of view (Fortran is column major).

If you want, HLFIR provides a tool to generate loop nest according to the list of extents:
https://github.com/llvm/llvm-project/blob/74adc3e0ebfb42a48f02d8d7094d6848a37a21f5/flang/include/flang/Optimizer/Builder/HLFIRTools.h#L382 (however, this is a one based loop nest, so not exactly what you have here).

clementval added inline comments.Jun 23 2023, 9:48 AM
flang/test/Lower/OpenACC/acc-reduction.f90
128–136

Good point! I'll update that.