The goal of this document is to:
- Allow the community to contribute to flang design by defining the expectations.
- Ensure there is a minimum of consistency between future design docs.
Differential D130166
[flang] Adding a guideline for flang design documentation jeanPerier on Jul 20 2022, 6:17 AM. Authored by
Details
The goal of this document is to:
Diff Detail
Event TimelineComment Actions Thanks @jeanPerier for creating this guideline. Do you want to clarify whether the scope of this document is limited to Lowering (parse-tree to MLIR, FIR, FIR transformations, FIR to LLVM)? Or is this a general guideline for all of Flang including for eg. Semantics, Runtime, OpenMP, OpenACC etc?
Comment Actions Thank you for the guideline, this should be really helpful!
Comment Actions I'd like to second @kiranchandramohan on having a document for features if possible. Also, as @awarzynski said, it would be good to get a sense of what features require a design document. Should this document be kept up to date as the feature is implemented and its design (presumably) evolves? Or is it essentially an RFC? In other words, once the feature is implemented and merged, in this document intended to serve as an overview of the implementation of the feature? Or will it become redundant once the feature is implemented and merged?
Comment Actions I wrote it with Lowering in mind because that is what I am working on, but I think it is generic guideline and up to the code owner of the different part to enforce it. @kiranchandramohan What is your take for OpenMP, is this how you want people to work ? A Github project page sounds like a great idea to me. I have not created any yet, and I see that there are now two options (beta and classic). @kiranchandramohan Do you have an opinion on which one we should use. Right, I think a github project list would be the best here.
It should not be a documentation of the implementation with the exact class names and interfaces... It should justify the solution, and explain some choices/rejected alternatives. So it is not superseded by the implementation. And yes, it should be updated if the solution is changed, if the solution evolves, the rational for it should be kept up to date (hence the small section about "Updating the implementation solution of a feature").
Comment Actions Currently there are two code-owners in LLVM Flang: @sscalpone and @schweitz (from CODE_OWNERS.TXT). Should it be updated? Comment Actions I like the idea of good design docs. We should have something like this for OpenMP as well. The only difficulty is that the OpenMP dialect and OpenMP IRBuilder sit outside the flang tree and can be worked on independently. So maybe any such discussions can be in discourse but before implementation in Flang (parse-tree to OpenMP + FIR dialects) we can make this a requirement for OpenMP as well subject to agreement of this proposal and consensus among OpenMP team members.
I have been using Classic mostly. No issues with beta as well but have not spent time understanding it.
Comment Actions Good point, what about adding: Features impacting projects outside of flang (like work OpenMP or OpenACC that may require touching parts outside of flang tree) should follow the general LLVM process, or the related subproject process. There should still be a related flang design docs if part of the solution impacts flang in significant way (e.g. it involves changes in the lowering from the parse-tree to OpenMP or FIR dialects that are not simply about mapping a parse-tree node to a related dialect operation). Right, not my call, I think it is probably fine as it is. I turned to Kiran as my OpenMP point of contact, any official code owner is of course welcome to speak up here :) I guess that given the codeowners, and Kiran's point, this document should apply to all feature changes where significant choices have to be made in flang tree. Basically, everything that will have a task with the "design" label under the future flang related subproject should rule what we requires a design doc. I do not want to turn this document into a feature list :)
Comment Actions How about creating one user manual using tree-structured directories in https://flang.llvm.org/docs/? Who submit the patch with new feature should also fill in the corresponding missed part in the tree. It not only can direct the compiler developers, but also serves users to use LLVM Flang compiler. What we can refer to is clang user manual, gfortran user manual, or NAG user manual.
Comment Actions @jeanPerier I see that @clementval has started the process in https://reviews.llvm.org/D131515 and https://discourse.llvm.org/t/rfc-lowering-design-doc-for-polymorphic-entities/64363. Are there still any issues left to be sorted out? Otherwise, we can try to submit this soon (after addressing any remaining comments). Comment Actions I added the note (slightly rephrased, and linking to https://llvm.org/docs/DeveloperPolicy.html#making-a-major-change). @kiranchandramohan, I updated the patch, and I believe I should have address all the comments (thanks @rovka and @bryanpkc for all the typo rephrasing suggestions). Please have a look at your convenience.
|
Can you clarify what you mean by "a new feature"? What changes are expected to come with a design doc?