This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add placeholder conversion pattern for disptach operations
ClosedPublic

Authored by clementval on Nov 11 2021, 3:39 AM.

Details

Summary

fir.dispatch, fir.dispatch_table and fir.dt_entry are operations
for type-bound procedures. This patch just adds placeholder conversion
pattern that currently fails since F2003 is not implemented yet.

This patch is part of the upstreaming effort from fir-dev branch.

Diff Detail

Event Timeline

clementval created this revision.Nov 11 2021, 3:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2021, 3:39 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 11 2021, 3:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2021, 3:39 AM
kiranchandramohan added inline comments.
flang/lib/Optimizer/CodeGen/CodeGen.cpp
374

Micro Nit: Lower of -> Lower
or
Lowering of

Similarly for others.

This revision is now accepted and ready to land.Nov 11 2021, 3:50 AM

Shall I do the same for fir.end? https://reviews.llvm.org/D113295

flang/lib/Optimizer/CodeGen/CodeGen.cpp
376

[nit] IMO, it would be helpful to mention F2003 in the notifyMatchFailure call. In fact, this comment can be replaced with with the message in notifyMatchFailure. That would be my preference. We tend to forget to update comments. Code forces us to update itself.

flang/test/Fir/convert-to-llvm-invalid.fir
26

How about a diagnostic check for fir.dt_entry?

clementval marked 3 inline comments as done.Nov 11 2021, 4:35 AM
clementval added inline comments.
flang/lib/Optimizer/CodeGen/CodeGen.cpp
376

I just removed the todo. I prefer not adding the Fortran standard in the op since it can conver several standard version. I think message not implemented yet is enough.

flang/test/Fir/convert-to-llvm-invalid.fir
26

Not possible since fir.dt_entry cannot be standalone.

clementval marked 2 inline comments as done.Nov 11 2021, 4:50 AM

Shall I do the same for fir.end? https://reviews.llvm.org/D113295

I didn't really follow the fir.end discussion but my intuition is that fir.end is probably converted together with its parent operation.

I didn't really follow the fir.end discussion but my intuition is that fir.end is probably converted together with its parent operation.

That's not what I saw in my experiments. Perhaps that's what we should aim for or something that we still need to port from fir-dev? Time will tell!

flang/test/Fir/convert-to-llvm-invalid.fir
26

I didn't really follow the fir.end discussion but my intuition is that fir.end is probably converted together with its parent operation.

That's not what I saw in my experiments. Perhaps that's what we should aim for or something that we still need to port from fir-dev? Time will tell!

Of course since the parent operations are not converted yet.