Skip to content

Roadmap

Steve Scalpone edited this page Mar 19, 2018 · 9 revisions

Flang Roadmap and Backlog

In-flight Projects

The following project are actively being developed now.

Integrating LLVM 6.0

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 text 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. NVIDIA is testing flang + llvm 6.0 to see if old workarounds can be removed or if new issues have arisen.

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 these meta data; other parts of Fortran are, for example, supported in DWARF, but there is no metadata to map 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.

Fortran 2008 pointer to inner procedures

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.

OpenMP 4.5 TARGET offload to GPU and multi-core

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, implementing SIMD and DECLARE SIMD 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 GPU offload support to Flang.

PGM precise/fast/relaxed intrinsics library

PGI is contributing a math intrinsic library. As part of that work, a patch to llvm to vectorize these intrinsics will be added to the flang branch of llvm.

TODO: Provide documentation for the intrinsic library and llvm vectorization patch.

Windows Port

Many pull requests are queued that enable Flang on Windows. These changes have been stalled by the lack of a Contributor License Agreement. Not that the CLAs are finished, the code owners and developers need to start integrating these patches.

Bug fixes

NVIDIA continues to contribute bug fixes. As of now, there's no indication in the github issue that a particular issue is being addressed.

Backlog

Fortran 2008 Features

Flang is a fairly complete Fortran 2003 compiler. Little work has been done to implement features of Fortran 2008 or Fortran 2018.

  • DO CONCURRENT
  • BLOCK construct
  • SUBMODULEs
  • Coarrays
  • Intrinsics and intrinsics used as initializers

C++ Migration

Flang is writting 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.

Replace printf with IRBuilder

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 source-code to C++.

Monolithic Front-end

The front 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.

  • LALR Parser has no hooks for tools
  • C program; monolithic without structured libraries
  • Written in C, not C++; makes 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

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 meaningful command-line options (in flang1 and flang2)