This is an archive of the discontinued LLVM Phabricator instance.

[flang] lower transpose intrinsic to hlfir.transpose operation
ClosedPublic

Authored by tblah on Feb 27 2023, 8:08 AM.

Diff Detail

Event Timeline

tblah created this revision.Feb 27 2023, 8:08 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 27 2023, 8:08 AM
tblah requested review of this revision.Feb 27 2023, 8:08 AM

Nits in the result type computation, looks good otherwise.

flang/lib/Lower/ConvertCall.cpp
1325

nit: arrayType simplify proof reading.

1332

/*polymorphic=*/false should be hlfir::Entity{operands[0]}.isPolymorphic();

You can test it with a polymorphic input adding --polymorphic-type to bbc.

Polymorphism support is ramping up in the current lowering, so HLFIR will have to be on par and beyond to switch.

tblah updated this revision to Diff 500830.Feb 27 2023, 9:30 AM

Thanks for review

Changes:

  • Rename array to arrayTy
  • Set isPolymorphic correctly
  • Add a test featuring transpose of a matrix polymorphic types
clementval added inline comments.
flang/test/Lower/HLFIR/transpose.f90
21

+1 thanks to add polymorphic tests!

jeanPerier added inline comments.Feb 28 2023, 12:01 AM
flang/test/Lower/HLFIR/transpose.f90
30

Thanks a lot for the update. The lit test failure is caused by the missing ? after the element type inside hlfir.expr to denote it is polymorphic: !hlfir.expr<2x1xnone?>

tblah updated this revision to Diff 501054.Feb 28 2023, 2:05 AM

Fix broken test

This revision is now accepted and ready to land.Feb 28 2023, 4:18 AM