This is an archive of the discontinued LLVM Phabricator instance.

[flang] Update fir.dispatch operation
ClosedPublic

Authored by clementval on Oct 6 2022, 6:05 AM.

Details

Summary

Update the fir.dispatch operation to prepare
the lowering part. nopass and pass_arg_pos attributes
are added in the arguments list so accessors are generated
by MLIR tablegen. A verifier is added as well as some tests.

This patch is part of the implementation of the poltymorphic
entities.
https://github.com/llvm/llvm-project/blob/main/flang/docs/PolymorphicEntities.md

Diff Detail

Event Timeline

clementval created this revision.Oct 6 2022, 6:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptOct 6 2022, 6:05 AM
clementval requested review of this revision.Oct 6 2022, 6:05 AM
jeanPerier accepted this revision.Oct 6 2022, 7:14 AM

Looks good to me (question inline, but I am not opposed to your approach).

flang/include/flang/Optimizer/Dialect/FIROps.td
2348

Why not encoding the no_pass as being the absence of pass_arg_pos ?

This revision is now accepted and ready to land.Oct 6 2022, 7:14 AM
PeteSteinfeld accepted this revision.Oct 6 2022, 7:15 AM

All builds and tests correctly and looks good.

clementval added inline comments.Oct 6 2022, 7:29 AM
flang/include/flang/Optimizer/Dialect/FIROps.td
2348

Yeah we can do it this way since we get a 0 from semantic when there is no PASS attribute. I'll update the patch in that direction. It is a good way to remove a check in the verifier.

clementval updated this revision to Diff 465751.Oct 6 2022, 8:31 AM

remove nopass attribute

This revision was automatically updated to reflect the committed changes.