To: J3 J3/20-157 From: Gary Klimowicz Subject: Flang Open Source Liaison Report Date: 2020-October-12 Flang Open Source Fortran Report ================================ Flang is an open source compiler for Fortran, sponsored by the US Department of Energy Exascale Computing Project (particularly, LLNL, Sandia and LANL). The goals of the project are to - Create a new, open source Fortran 2018 compiler with Apache 2.0 licensing, - that can be used for language and parallelization experimentation, - that exists as a peer in the LLVM community of languages, like Clang, - that can rely on LLVM code generation and parallelism support for CPUs and GPUs. Flang (formerly known as f18) is LLVM's Fortran front-end and is officially included in LLVM 11, which was released today. Flang is now following the same development process as other LLVM projects (the GitHub monorepo for source management, Bugzilla for issue tracking, and Phabricator for code review). Work continues on the original Flang compiler (now largely referred to as "Classic Flang"). Developers from Arm Ltd, AMD and Huawei have made the bulk of the recent contributions. There are LLVM-hosted email lists for Flang (flang-dev and flang-commits). This version of Flang will ultimately replace the current Flang compiler after a period of transition where both compilers are supported. There is a Slack workspace, http://flang-compiler.slack.com/ for more interaction with the Flang community at large. NVIDIA hosts a biweekly half-hour conference call providing status updates on Flang. It is held every other Wednesday at 8:30 AM Pacific time (the next is October 14, 2020). Notes from these calls are sent to the LLVM flang-dev email list. Johannes Doerfert of Argonne National Laboratories hosts a biweekly Flang Community Technical call Mondays 8:30 AM Pacific Time on the weeks alternating with the above call. The next call is scheduled for October 19, 2020. There is a Google Doc with meeting agendas and minutes at https: //docs.google.com/document/d/1Z2U5UAtJ-Dag5wlMaLaW1KRmNgENNAYynJqLW2j2AZQ (line split due to line length restrictions). There is also a Classic Flang biweekly call, held at the same time as the original call, but on alternate weeks. The next call is scheduled for October 21, 2020. The New LLVM Flang Compiler --------------------------- This new front-end is available at https://github.com/llvm/llvm-project (the monorepo) in the flang/ directory. No contributor license agreement is needed to contribute to LLVM Flang, which is being developed under the Apache 2.0 license with LLVM exceptions (the same as LLVM and Clang). The current state of LLVM Flang compiler is - written in modern C++ following LLVM conventions - over 165,000 lines of code, tests and scripts - parses all of Fortran 2018 to abstract syntax trees (AST) - parses and OpenMP 4.5 and some OpenMP 5.0 - parses some OpenACC 3.0 - implements preprocessing directives - implements nearly all semantic checks - defines a "Fortran Intermediate Representation" based on LLVM's MLIR - can lower some OpenMP and OpenACC constructs - can compile and correctly run Fortran 77 programs (passes FCVS test suite) Upcoming work includes - completing constraint checking - completing lowering to FIR, OpenMP IR, LLVM IR - completing definition of the runtime environment - implementation of runtime - building up test suite Current Flang Compiler ---------------------- The initial version of Flang is derived from the PGI Fortran compiler, with some proprietary features removed (OpenACC support, inter-procedure analysis). Recent improvements to Flang include - many bug fixes and enhancements from the PGI compiler - support for LLVM 8.0, LLVM 9.0 - support for LLVM 10.0 using the LLVM monorepo - bug fixes - enhanced Fortran debug metadata support Current Flang is available for Linux on x86-64, OpenPOWER and Arm processors, and is the basis of the Arm commercial Fortran compiler. AMD has adopted Classic Flang as well. Huawei has begun to contribute, too. We have opened the development of the original Flang compiler to new committers and have a pull request validation process in place.