Notes from the Flang Roundtable

Hi fellow Flang developers!

Below are the notes taken during the Flang Roundtable at the LLVM Dev Meeting today. Please feel free to comment with corrections and/or questions.

Thanks!

– Alexis

I had to leave the call early so I don’t know whether the topics below were addressed. Hopefully my comments below are useful.

OTHER TOPICS

  • Driver can make an executable now!
    • Is now a good time to switch name from flang-new to flang?

This it sounds like a good idea to me. On a possibly related note, at what point in the process does an end user have the experience of installing flang and producing an executable file with something like “flang hello_world.f90”? And when will the end user be able to install flang via common package managers?

  • Two different ways to approach continued development: keep chasing standards or make a high-quality F95 compiler with optimizations and such?

The utility of a compiler only becomes non-zero once the compiler supports the standards a code uses. Every project I lead uses Fortran 2018. Also, any support for Fortran 2018 parallel features might improve performance more than optimizing Fortran 95 serial features. For example, any time spent on optimizing the Fortran 95 FOR ALL statement would be better spent offloading DO CONCURRENT to GPUs – especially given that the Fortran 2018 standard officially declares FOR ALL to be obsolescent. Fortran 2018 also deletes some features so you probably don’t want to optimize any of those.

Progressing through the standards chronologically also means missing some attractive low-hanging fruit. For example, supporting the Fortran 2018 collective subroutines is much easier than supporting Fortran 2008 coarrays. I’ve worked on several production applications for which the collective subroutines provide all of the parallel communication needs even with no coarrays anywhere in the codes.

If the decision is to focus on Fortran 2003 next, will patches for more recent standards be accepted?

Damian

Regarding the support for various Fortran standards and whether to optimize features from older standards… I appreciate that there are modern codebases out there that may rely solely on the newest version of the standard, but there are still a LOT of important codes that have not gone past F2003, if that, and we need to support those use cases as well. These codebases may not have the ability (read financial, logistical, etc.) to be rewritten in the newest version of Fortran, so we as compiler developers need to help them make their codes as fast as possible by providing a high-quality optimizing compiler even on the old standards.

If the decision is to focus on Fortran 2003 next, will patches for more recent standards be accepted?

I think we should definitely accept contributions for newer language standards. Doing so would allow interested parties to implement what they need, without having to wait for the rest of the earlier standards that they don’t need. That would make Flang more useful to more users earlier.

Same argument for performance – we should be accepting any patch that results in more clean/optimal FIR or LLVM IR output.

Ta

Rich

    _OTHER TOPICS_____

      * Driver can make an executable now!____
          o Is now a good time to switch name from flang-new to flang?

This it sounds like a good idea to me.

In general, people would like `flang` to remain the LLVM Flang tool that can generate executables. That's the main blocker here.

On a possibly related note, at what point in the process does an end user have the experience of installing flang and producing an executable file with something like "flang hello_world.f90"?

This will be available on `fir-dev` once #1215 [2] is merged. As for `main` - depends on the progress with upstreaming.

And when will the end user be able to install flang via common package managers?

We would have to ask people involved in preparing these packages. We are getting there though - starting from LLVM 13, Flang is included with the binary packages released by LLVM [1].

[1] https://github.com/flang-compiler/f18-llvm-project/pull/1215
[2] Releases · llvm/llvm-project · GitHub