Nvidia Offers New Fortran Frontend To LLVM
Written by Kay Ewbank   
Monday, 04 March 2019

Nvidia is proposing their ground-up rewrite of the Fortran front-end for LLVM, f18, becomes an LLVM project.

F18 is a front-end for Fortran. It is intended to replace the existing front-end in the Flang compiler. Flang is a Fortran compiler targeting LLVM that was developed by Nvidia in conjunction with the US Department of Energy's National Nuclear Security Administration.

nvidialogo

LLVM (Low Level Virtual Machine)) is a compiler infrastructure that consists of a collection of libraries and tools for optimizing compilers and just-in-time code generators. Despite the name, LLVM is more an intermediate language that can be targeted by a compiler and then translated to various actual machine codes. The best known LLVM compiler is Clang for C/C++/Objective C. 

Nvidia developed an open-source Fortran front-end for LLVM that consists of the flang front-end along with the corresponding Fortran runtime library. The existing front-end's code is mostly written in C, and the developers at Nvidia say that while it's a production-quality implementation, it doesn't follow modern software-engineering practices. This means that it is unlikely to be accepted as part of the LLVM project to be further developed by the LLVM community. The Nvidia team also have an ambition that Flang and the front-end become useful in the many ways that Clang is useful: not just as a front-end, but also for static analysis and tooling.

Because the current flang's code base wouldn't meet these needs, Nvidia has been working on a ground-up rewrite of the front-end in modern C++. This project is called f18.

At this point, the Nvidia team has documented and implemented what they describe as a healthy subset of the compiler for symbol tables and scoping, name resolution, USE statements and module files, constant representation, constant folding and much of declaration, label and expression semantics. The parser handles all of Fortran 2018 and OpenMP 4.5 and implements a Fortran-aware preprocessor. The Fortran control flow graph (CFG) is in review now. 

The consensus at Nvidia is that the project is now at a point where the best route forward is that f18, and the existing Fortran runtime libraries, are contributed to the LLVM project. The Fortran front-end would become a proper LLVM subproject, design discussions would take place on an associated LLVM mailing list, code reviews would use phabricator, and so on.

Writing on the LLVM developer mailing list, the developers at Nvidia say:

"We're committed to developing LLVM's Fortran front-end for years to come, and together with other members of the LLVM community (e.g., ARM, US Dept of Energy) would like to do so as part of the LLVM project."

Alongside flang, Nvidia has developed a library of scalar, vector, and masked math functions that the team is also proposing for inclusion in LLVM. 

While there are some aspects of the project that require negotiation (such as the use of C++17 for some parts of f18 where LLVM is standadised on C++11), it looks like f18 may well become an LLVM project this year. The f18 front-end is already hosted on GitHub under the Flang compiler project.

nvidialogo

 

More Information

flang Compiler on GitHub

Related Articles

Nvidia Open Sources Physics Engine

Clang Now Compiles Chrome For Windows

Clang 3.4 Released

Recognition for LLVM    

NVIDIA's Turing - A Big Leap Forward For GPUs

NVIDIA's Neural Network Drives A Car

NVIDA Updates Free Deep Learning Software

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Gender Differences In Coding Style
13/11/2024

A novel investigation into the gender gap between men and women regarding coding ability was undertaken by Dr Siân Brooke. Her conclusion? There is a difference in the Python code [ ... ]



Ursina - A Game Engine Powered by Python
08/11/2024

Ursina is a new open source game engine in which you can code any type of game in Python, be it 2-D, 3-D, an application, a visualization, you name it.


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info