Skip to content

Roadmap

Gary Klimowicz edited this page Feb 21, 2020 · 9 revisions

Flang Roadmap and Backlog

The Flang 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 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

It's been determined that the fastest way to resolve these issues is to rewrite the Fortran front-end. We call this new front-end F18.

We believe that starting in 2020, F18 will replace the current Flang as a complete implementation of Fortran 2018.

The current Flang will continue to be supported while projects make the transition to the F18.

F18 New Fortran Front-End

The new Fortran 2018 front-end is being developed entirely in open source.

See the F18 Projects page for the list of current projects and for opportunities to contribute to the new front-end.

The F18 driver

The community is discussing options for the F18 driver program (to be called flang).

It would be good if the flang changes could be pushed upstream.

LLVM infrastructure libraries

LLVM has infrastructure classes that support, among other things, option handling and file systems. F18 will leverage these.

Current Flang

The following projects are actively being developed for the existing Flang compiler.

Integrating LLVM 8.0

The LLVM 8.0.0 final release was recently announced. Flang can be built with LLVM 7.0.1 and LLVM 8.0.

Status 24.May.2019: The forked llvm and flang-driver are up-to-date with release 8.0.

Better Fortran debugging information

By default, LLVM supports a rich set of debug metadata for C and C++. Some parts of Fortran map well to this metadata; other parts of Fortran are supported in DWARF but there is no LLVM metadata that maps to that DWARF. The flang fork of llvm implements several extensions for Fortran. The Flang team works to upstream these changes into LLVM.

Debug Metadata Plan

Bug fixes

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.

Windows Port

Many pull requests are queued that enable Flang on Windows. Now that the project is licensed under the new Apache 2.0 with LLVM Exceptions license, the code owners and developers can start integrating these patches.

MacOS Port

The PGI compiler runs on Mac. Porting flang to Mac should be relatively straightforward.

Backlog

See the Flang Issues page for opportunities to contribute to the current version of Flang.

Rework Obscure Option Handling

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)

Documentation

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.