This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add a test case for `fir.dt_entry`
AbandonedPublic

Authored by awarzynski on Nov 11 2021, 5:19 AM.

Details

Reviewers
clementval
Summary

Diff Detail

Event Timeline

awarzynski created this revision.Nov 11 2021, 5:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2021, 5:19 AM
awarzynski requested review of this revision.Nov 11 2021, 5:19 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 11 2021, 5:19 AM
kiranchandramohan added inline comments.
flang/test/Fir/convert-to-llvm-invalid.fir
37

I think @clementval was suggesting that dt_entry should always. come inside a dispatch_table. The fact that dt_entry can be written in module scope shows that it is missing some constraints.

I think dt_entry operation should have the HasParent constraint where the parent is the dispatch_table.

https://mlir.llvm.org/docs/Traits/#hasparent
https://github.com/llvm/llvm-project/blob/9534e361ea12aaecde52b8ac4c947f9a301d0c9b/mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td#L155

I was thinking that the test was skipped because if it has the constraint maybe we never reach the conversion of dt_entry and hence the error is never produced.

clementval added inline comments.Nov 11 2021, 5:55 AM
flang/test/Fir/convert-to-llvm-invalid.fir
37

Cannot summarized it better than @kiranchandramohan. Doesn't really makes sense to have a fir.dt_entry alone in the wild.

awarzynski abandoned this revision.Nov 11 2021, 6:58 AM
flang/test/Fir/convert-to-llvm-invalid.fir
37

I was thinking that the test was skipped because if it has the constraint maybe we never reach the conversion of dt_entry and hence the error is never produced.

The conversion *is hit*, so clearly something is missing somewhere :) I added this test so have something that documents the current behavior. If that conversion is never hit (nor it should be), then perhaps it ought to be deleted?

Anyway, thanks for the context and for clarifying! Let's try ttps://reviews.llvm.org/D113674 instead.