Flang support in LLVM (FLANG)

Introduction

Linaro and Linaro Members' are working on flang targeting AArch64 on Linux and Windows. Linux has had a head start in flang, so in general Linux support has been slightly ahead of Windows support. Therefore, part of our work is to bring Windows on Arm (WoA) support to the same level of parity as Linux. However, we also strive to improve flang in general, for any platform. Enabling Flang in LLVM is a big project with plenty of work for to go around.

 

Scope

  • Include flang in AArch64 releases for both Linux and Windows

  • Provide CI for flang for both Linux and Windows, running check-all and the llvm-test-suite

  • Test relevant open-source workloads with flang; add them to CI if license/resources permit

  • Fix bugs, add missing features as needed by the workloads that we choose to prioritize

  • Check flang’s integration with CMake and provide CI if necessary

  • Publish developer notes on how to generate a WoA binary

  • Help the flang community as much as possible (e.g. with upstreaming from fir-dev/classic-flang)

Project lead(s): @Carlos Seo

Project Contacts

Source Code

LLVM Buildbots CI

LLVM Releases

Upstream Wiki

Upstream Collaboration (Slack, Technical and Community calls etc)

Production-Ready Criteria

Flang will be considered production-ready when:

  • It’s able to build the following packages:

    • SPEC CPU2006

    • SPEC CPU2017

    • OpenBLAS

    • SciPy

    • NumPy

  • Its performance is no slower than 25% that of gfortran (and/or Classic Flang?) in SPEC CPU2017 (rate), in any of the benchmarks
    (Check current status between flang and gfortran, in SPEC CPU2017)

Also, the community currently agrees that flang-new will be renamed to flang only when:

  • HLFIR is the default.

  • Procedure pointers support is implemented.

  • The -flang-experimental-exec option is removed.

Active Tasks and Coordination

  • We are currently targeting: SPEC2017, SPEC2006, OpenBLAS, SciPy, NumPy

  • OpenBLAS

    • We have committed some fixes to flang to enable it to build OpenBLAS on WoA

  • SPEC2017 is tracked upstream in this board:

  • NumPy

    • Testsuite fixes

    • Missing support for procedure pointers: Peixin (Huawei) from upstream is working on implementing this. A few patches were recently committed.

  • SPEC2006

    • All benchmarks are passing except 465.tonto, which fails at compile time because of 2 issues

    • Qualcomm is working on one of them, the upstream community is working on the other

  • SNAP is known to work with flang, Linaro has been reviewing a patch to add it to the test-suite

Achievements and Status

  • SciPy

    • All issues fixed and committed upstream. SciPy now builds with Flang with all tests passing.

  • NumPy

    • Now Compiles with flang but has 4 testsuite failures.

  • SPEC2017

    • Flang now passes SPEC2017 correctness.

  • Flang included in LLVM releases:

    • Linux: since LLVM 14

    • Windows: since LLVM 15

  • Buildbots running check-flang:

    • Linux: 12 configurations

    • Windows: 2 buildbot (flang is the first subproject for which the tests have been enabled on the WoA buildbots)

  • Buildbots running the llvm-test-suite

  • CI testing flang + CMake:

  • Developer notes:

  • Upstreaming of the fir-dev branch is now considered complete (Linaro has contributed several patches & code reviews to this effort)

  • Contributions to flang’s runtime libraries, WoA support, bugfixes etc

  • Upstream code reviews

 

Current Plan

key summary created status due fixversions
Loading...
Refresh

Backlog

key summary created status
Loading...
Refresh

Accomplished

key summary created status resolutiondate
Loading...
Refresh

Linaro Ltd.