-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[Flang] Add a Fortran Standards Support doc #132195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Flang] Add a Fortran Standards Support doc #132195
Conversation
3eb1775
to
c03e566
Compare
c03e566
to
a0460e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, with the few nits that I have commented on.
I guess we should see if we can get a list of updates from J3/WG5 for 2018 and 2023 Fortran to populate the list. We also should list intrinsic functions explicitly if there are supported (or not).
Standards support is provided upto Fortran 2008 for now. It will be later extended for Fortran 2018 and Fortran 2023. | ||
|
||
The standards support information is provided as a table with three columns that are self explanatory. The Status column uses | ||
the letters **P**, **Y**, **N** for the various implementation status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the letters **P**, **Y**, **N** for the various implementation status. | |
the letters **P**, **Y**, **N** for the implementation status: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
--> | ||
|
||
# Flang's Fortran standards support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Flang's Fortran standards support | |
# Flang Fortran Standards Support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Kiran. Just a few nits and comments.
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits | ||
TODOs/Not Yet Implemented messages for unimplemented features and that should be treated as the authoratative information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits | |
TODOs/Not Yet Implemented messages for unimplemented features and that should be treated as the authoratative information. | |
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The | |
TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits | ||
TODOs/Not Yet Implemented messages for unimplemented features and that should be treated as the authoratative information. | ||
Standards support is provided upto Fortran 2008 for now. It will be later extended for Fortran 2018 and Fortran 2023. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Standards support is provided upto Fortran 2008 for now. It will be later extended for Fortran 2018 and Fortran 2023. | |
Standards support is provided upto Fortran 2008 for now. It will be extended later for Fortran 2018 and Fortran 2023. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"upto" should be "up to"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed this sentence.
- **N** : When the implementation is absent | ||
|
||
Note 1 : No distinction is made between the support in the Parser/Semantics and MLIR or Lowering support. | ||
Note 2 : Besides the features listed below a few intrinsics like MIN/MAX are not supported for a few cases with CHARACTER type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a list of the intrinsics where support for CHARACTER
types is incomplete? If it is not too difficult to identify these, a complete list may be better than alluding to "a few intrinsics".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have a list of intrinsics here. The only ones I am actually aware or the MIN/MAX intrinsic. Since I was not 100% I am making a conservative statement here. Do we want to just say MIN/MAX only? Do you have additional info in the gfortran testsuite?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can check to see if there are any failures as a result of this. I don't know off the top of my head.
--- | ||
``` | ||
|
||
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we take the suggested change above, should we also remove 's
here? Or just rephrase it to:
This document summarizes Fortran standards support in Flang.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Note 1 : No distinction is made between the support in the Parser/Semantics and MLIR or Lowering support. | ||
Note 2 : Besides the features listed below a few intrinsics like MIN/MAX are not supported for a few cases with CHARACTER type. | ||
|
||
## Fortran 77 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FORTRAN 77 - consistent with what we use in FortranFeatureHistory.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
Note 1 : No distinction is made between the support in the Parser/Semantics and MLIR or Lowering support. | ||
Note 2 : Besides the features listed below a few intrinsics like MIN/MAX are not supported for a few cases with CHARACTER type. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all the contents in the first three sections are the same, I suggest to consolidate to the FORTRAN77, Fortran 90 and Fortran 95
section. In addition, if we take Michael's suggestion to populate the Fortran 2018
and Fortran 2023
sections, I suggest to re-order the sections to start with Fortran 2023
first. I think people are more interested in which newer features that flang support nowadays.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reorganized in descending order of standards. I do not have entries for 2018 and 2023 now. If it is OK, we can add that in subsequent PRs.
I have not consolidated FORTRAN77, Fortran 90 and Fortran 95. I can do so before submitting if there are no reports of unsupported features in this review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A couple of nits added inline.
|
||
| Feature | Status | Comments | | ||
|------------------------------------------------------------|--------|---------------------------------------------------------| | ||
| Parameterized Derived Types | P | PDT with length type is not supported. See [Proposal](ParameterizedDerivedTypes.md) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
length type => length type parameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| Parameterized Derived Types | P | PDT with length type is not supported. See [Proposal](ParameterizedDerivedTypes.md) | | ||
| Assignment to allocatable | P | Assignment to whole allocatable in FORALL is not implemented | | ||
| Pointer Assignment | P | Polymorphic assignment in FORALL is not implemented | | ||
| The VOLATILE attribute | P | Volatile in procedure interfaces is not implemented | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Volatile => VOLATILE
as it refers to the attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This looks very good! Do you plan to do the same for Flang+OpenMP as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for putting this together Kiran
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed review comments.
|
||
--> | ||
|
||
# Flang's Fortran standards support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
--- | ||
``` | ||
|
||
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits | ||
TODOs/Not Yet Implemented messages for unimplemented features and that should be treated as the authoratative information. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
This document summarizes Flang's Fortran standards support. The information is only provided as a guideline. The compiler emits | ||
TODOs/Not Yet Implemented messages for unimplemented features and that should be treated as the authoratative information. | ||
Standards support is provided upto Fortran 2008 for now. It will be later extended for Fortran 2018 and Fortran 2023. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Standards support is provided upto Fortran 2008 for now. It will be later extended for Fortran 2018 and Fortran 2023. | ||
|
||
The standards support information is provided as a table with three columns that are self explanatory. The Status column uses | ||
the letters **P**, **Y**, **N** for the various implementation status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- **N** : When the implementation is absent | ||
|
||
Note 1 : No distinction is made between the support in the Parser/Semantics and MLIR or Lowering support. | ||
Note 2 : Besides the features listed below a few intrinsics like MIN/MAX are not supported for a few cases with CHARACTER type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not have a list of intrinsics here. The only ones I am actually aware or the MIN/MAX intrinsic. Since I was not 100% I am making a conservative statement here. Do we want to just say MIN/MAX only? Do you have additional info in the gfortran testsuite?
Note 1 : No distinction is made between the support in the Parser/Semantics and MLIR or Lowering support. | ||
Note 2 : Besides the features listed below a few intrinsics like MIN/MAX are not supported for a few cases with CHARACTER type. | ||
|
||
## Fortran 77 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
| Feature | Status | Comments | | ||
|------------------------------------------------------------|--------|---------------------------------------------------------| | ||
| Parameterized Derived Types | P | PDT with length type is not supported. See [Proposal](ParameterizedDerivedTypes.md) | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| Parameterized Derived Types | P | PDT with length type is not supported. See [Proposal](ParameterizedDerivedTypes.md) | | ||
| Assignment to allocatable | P | Assignment to whole allocatable in FORALL is not implemented | | ||
| Pointer Assignment | P | Polymorphic assignment in FORALL is not implemented | | ||
| The VOLATILE attribute | P | Volatile in procedure interfaces is not implemented | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
I am leaving this for a future patch. 2023 should be fairly straightforward. I do not have the data for Fortran 2018.
Agree, ATM I do not have this data.
Yes. |
f18 has all of F'2018 except F'2023 support is completely absent and nobody is working on it. |
Thanks @klausler for the info. I will add sections for Fortran 2018 and 2023.
Is there a specific reason you called out the
A few of them seem to have support |
I skimmed my notes of F'2018 additions and
Fair enough. The lack of limits on continuation lines and statement length have always been present, so I never thought of them as new features. But F'2023 was a minor revision, and includes some weird features (e.g. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
|
||
## Fortran 2018 | ||
All features except those listed in the following table are supported. Almost all of the unsupported features are related to | ||
coarrays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coarrays. | |
multi-image execution. |
Many multi-image parallel features have do not necessarily involve coarrays (e.g., collective subroutines and teams).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to how the parallel support for do concurrent
is described below as in progress, please state the support for multi-image features is in progress.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now have the following sentence:
Almost all of the unsupported features are related to the additional parallel features (coarrays/teams/collectives).
The support status of collectives and teams are individually called out in the status table for Fortran 2018.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiranchandramohan thanks for making the edits. "Parallel features" could be interpreted to include parallelization of do concurrent
so I'd still suggest "multi-image" to replace "parallel."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Made the suggested change.
@mjklemm the list of changes is in the Introduction to the Fortran 2023 Interpretation Document. |
|
||
## Fortran 2018 | ||
All features except those listed in the following table are supported. Almost all of the unsupported features are related to | ||
coarrays. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly to how the parallel support for do concurrent
is described below as in progress, please state the support for multi-image features is in progress.
| Using integer arrays to specify subscripts | N | | | ||
| Using integer arrays to specify rank and bound of an array | N | | | ||
| Using an integer constant to specify rank | N | | | ||
| Reduction specifier for do concurrent | Y | | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is still in progress. @ergawy can confirm. Should the status be N
or P
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is supported for the pure Fortran case, for the do concurrent
-> OpenMP case (or do concurrent
parallelization in general), this is not supported yet. So I think @kiranchandramohan is indeed correct here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kiranchandramohan actually I hadn't thought about the difference between serial support and parallel support. My point was that I didn't even realize that serial support for reduce
existed yet on the main branch of llvm-project. I'm building flang
now and will try it out. If serial support works, then I think either "Y" or "P" is fine and I leave it up to you to decide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Looks like you used the following document for the Fortran 2023 features:
https://wg5-fortran.org/N2201-N2250/N2212.pdf
You may also want to pull in the features from the Fortran 2008/2018 Compiler
Conformance charts that Ian Chivers and Jane Sleightholme were compiling. You can find them at https://www.fortranplus.co.uk/fortran-information/
Thanks, Mark. I have added references to the What is new in Fortran 2023 and 2018 Fortran documents. I believe the Compiler Conformance charts are based on these documents. I plan to submit this PR on Tuesday if there are no objections. |
Hi Kiran, apologies for late comments. I hope they are relatively minor additions if you choose to incorporate them. For the missing 2018 features, in the comment column, it would help to add "coarrays" or similar to highlight that the major missing feature is coarrays and a lot of gaps. It might be nice to call out at the top of the doc that the major missing features are coarrays and PDT with length type parameters. If you agree these are the only major missing features. Thank you! |
22bd5c0
to
04fb498
Compare
Thanks Steve for the review.
Added "Multi-image/Coarray feature" in the comment column.
Added a Note in the first section.
Changes are in 04fb498 |
- **Y** : When the implementation is complete | ||
- **N** : When the implementation is absent | ||
|
||
There is no distinction made between support in the Parser/Semantics and the MLIR or Lowering stages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is now repeated (just above the P/Y/N there's an equivalent one).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Removed the former occurence.
the letters **P**, **Y**, **N** for the implementation status: | ||
- **P** : When the implementation is incomplete for a few cases | ||
- **Y** : When the implementation is complete | ||
- **N** : When the implementation is absent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think we should make this easier for readers (explain the letters, order them by degree of completion)
the letters **P**, **Y**, **N** for the implementation status: | |
- **P** : When the implementation is incomplete for a few cases | |
- **Y** : When the implementation is complete | |
- **N** : When the implementation is absent | |
the letters **Y**, **P**, **N** for the implementation status: | |
- **Y** (Yes): When the implementation is complete | |
- **P** (Partial): When the implementation is incomplete | |
- **N** (No): When the implementation is absent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. The following format was used.
- **Y** : Yes. When the implementation is complete
No description provided.