This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Array constructor lowering [part 2/4]
ClosedPublic

Authored by jeanPerier on Feb 15 2023, 8:27 AM.

Details

Summary

This patch adds the lowering strategy that lowers an array constructor
to an hlfir.elemental (without creating any temporary yet in lowering).
This will allow more high level array expression optimization to elide
the array constructor temporary when possible, but this is only doable
for a restricted although common form of array constructors:
"[(pure_scalar_expr(i),i=lower,upper,stride)]".

Depends on D144102

Diff Detail

Event Timeline

jeanPerier created this revision.Feb 15 2023, 8:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 15 2023, 8:27 AM
jeanPerier requested review of this revision.Feb 15 2023, 8:27 AM
tblah accepted this revision.Feb 15 2023, 9:49 AM

Looks good to me

This revision is now accepted and ready to land.Feb 15 2023, 9:49 AM
PeteSteinfeld accepted this revision.Feb 15 2023, 2:36 PM

All builds and tests correctly and looks good.

flang/lib/Lower/ConvertArrayConstructor.cpp
227

This should read "... only gathers the operands to create ..."

jeanPerier marked an inline comment as done.

Fix typo in comments. Thanks for the review.

This revision was automatically updated to reflect the committed changes.