-
Notifications
You must be signed in to change notification settings - Fork 139
Roadmap
The following projects are actively being developed now.
The LLVM 6.0.0 final release was recently announced. After a new branch of LLVM is created, the Flang forks of LLVM and Clang must be updated. Often, because flang does not use IRBuilder, flang must be updated to match any changes in the textual form of LLVM IR or its debug metadata.
Status 19-March-2018: The forked llvm and clang (flang-driver) are up-to-date with release 6.0. NVIDIA is testing flang + llvm 6.0 to see if old workarounds can be removed or if new issues have arisen.
By default, LLVM supports a rich set of debug metadata for C and C++. Some parts of Fortran map well to these meta data; other parts of Fortran are, for example, supported in DWARF, but there is no metadata maps to that DWARF. The flang fork of llvm implements several extensions for Fortran. Work is actively underway on this effort.
TO DO: Add pointers to the analysis and progress reports.
Work is underway to support the new Fortran 2008 features. In Flang, pointers are generally represented as a pointer to data and a pointer to a descriptor. For pointers to inner procedures, the descriptor represents the closure of the procedure.
Flang already implements most of OpenMP 4.5 for multi-core CPUs. This functionality is enabled by default with -fopenmp. It is implemented on top of the existing pre-4.5 OpenMP runtime API (kmpc). More work is underway, for example, SIMD and DECLARE SIMD are implemented as compiler hints to disable dependency checks and inline functions, respectively.
Clang is being updated to support OpenMP 4.5 TARGET offloading to a GPU. A team at NVIDIA is following the Clang model to add offload support to Flang.
PGI is contributing a math intrinsic library. As part of that work, a patch to llvm to vectorize these intrinsics is being prepared for the flang fork of llvm.
TODO: Provide documentation for the intrinsic library and llvm vectorization patch.
Many pull requests are queued that enable Flang on Windows. These changes have been stalled by the lack of a Contributor License Agreement. Now that the CLAs are finished, the code owners and developers need to start integrating these patches.
Bugs are tracked using GitHub Issues. NVIDIA continues to contribute bug fixes, both in response to GitHub issues and bug reports from its customers.
As of now, there's no indication in the GitHub Issue that someone is working on a particular issue.
Flang is a fairly complete Fortran 2003 compiler. Little work has been done to implement features of Fortran 2008 or Fortran 2018.
We have gotten input and feedback from various sources about the relative priority of Fortran 2008 features.
The current priority of the F2008 features is:
- Pointers to inner procedures
- DO CONCURRENT
- BLOCK construct
- SUBMODULEs
- Coarrays
- Intrinsics and intrinsics used as initializers
TO DO: Add the full list of 2008 features
Flang is written in C, not C++. This makes code sharing and reuse of LLVM components difficult.
The top priority here is to convert flang02 to the C-like subset of C++ so IRBuilder can replace printf.
A number of users and potential contributors have complained that flang IR generation is more difficult than it needs to be because IRBuilder is not used.
A good implementation of this change depends on converting flang02 to C++.
The front end is a large, monolithic C program. Functionally, flang is a good compiler. Its major data structures and intermediate forms are well documented. The base source code, from PGI, has been used in many many successful Fortran projects.
However, that said, Flang has shortcomings when compared to modern compilers:
- LALR Parser has no hooks for tools
- A monolithic C program without structured libraries
- Written in C, not C++, making code sharing and reuse difficult
- Error messages do not convey much context or detail compared to clang
- AST is lowered early; not suitable for source-to-source translation
- Missing Fortran 2008 and 2018 features
- Difficult for new users to engage
Flang configuration and options are built on -x flags and x bits. In the past, this style of option capture was commonplace; nowadays programmers expect well-named objects.
- Source-code uses x bits instead of meaningful variable names
- Command-line uses obscure -x flags instead of meaningful command-line options (in flang1 and flang2)
The driver for flang is a modified version of clang. Changes to clang are in a forked repository, flang-compiler/flang-driver.
It would be good if the flang changes could be pushed upstream.
LLVM has infrastructure classes that support, among other things, option handling and file systems.
The PGI compiler runs on Mac. Porting flang to Mac should be relatively straightforward.
Flang runtime descriptors, including array descriptors, are described in
the file flang/runtime/flang/fioMacros.h
.
This documentation could be expanded and written to be extracted with doxygen.