[PROPOSAL] Rename `flang-new` to `flang`

Like OpenBSD we removed classic flang from the tree a while ago. At the time I didn’t think anyone was aware it was being ported forward, but at this point all our infrastructure for Fortran uses gfortran so the impact was low.

If it breaks the impasse I’d be happy with flang being installed as llvm-fortran for 17.

2 Likes

llvm-fortran would be a perfect permanent name as well.

No. This was already discussed above. It must be Flang and Clang. As an intermediate step you may prefix Flang with llvm to avoid confusion with the classic flang. IMHO, llvm-flang is an improvement over flang-new.

1 Like

Strongly agree here. Branding is hard. Naming is hard. Managing packages is hard. Removing flang from the name throws a massive sideways wrench in all those hard problems.

Some distros use git-<package> or <package>-git to show that this is a development version of the package named <package>. It is widely accepted that git packages are the same as their non-git counterparts in functionality, only more unstable and with new features.

Naming it flang-git or git-flang would also be technically correct, since we are using git.

But in the end, anything that has flang in its name is better than any other alternative.

2 Likes

This is a thought more than a proposal, but in our conclusion above we suggested that packagers should install flang as llvm-flang (at least for now), but it’s named flang-new in the repo. Should we change the name in the repo to llvm-flang to make that clearer and give packagers one less thing to do?

Playing devils advocate a little bit, is changing the name to llvm-flang for now making it less likely that there will be strong support to change it to just flang later? Since llvm-flang doesn’t seem as much like an obviously temporary name as flang-new?

Given that we’re not renaming it to its “official” name yet, I don’t really have that strong of an opinion on what its temporary name is.

The patch has now landed to remove the -flang-experimental-exec flag. You can now compile with just flang-new hello.f90

4 Likes

Is there a way to follow the progress on the HLFIR effort, e.g. any of: a tracking issue, a milestone, a project, a status page? I checked for all 4 without success, but maybe I’ve missed something.

The status is generally captured in the Flang calls. The latest update from the call last Monday can be found in the following document (page 6). I am copying it below for reference.
https://docs.google.com/document/d/1Z2U5UAtJ-Dag5wlMaLaW1KRmNgENNAYynJqLW2j2AZQ/edit#heading=h.vpxs8lkuxy79

Implementation Progress:
HLFIR (High LevelLFIR (High Level FIR dialect)

  • Most of issues with intrinsic ops were fixed last week.
  • Only two relatively big TODOs. Affects about 10 tests. Character conversion (Anthony working on this), Paranthesized Polymorphic arrays.
  • In a good shape correctness-wise. Testing with HLFIR + Polymorphic type enabled. Will do with intrinsic ops enabled.
  • Currently around 100 failures. Some of them do not work with FIR. So the failure rate is lower. Next is investigating performance. Will prioritise based on this investigation.
  • Enabling HLFIR end to end OpenMP tests make sense right now. Please have a look to see whether something needs to be done.
  • As soon as we can switch, the better. This needs an RFC.
  • Please test and give it a try.

The gfortran testsuite running as part of llvm-testsuite contains a list of Disabled tests with HLFIR. An initial list can be found in the patch : ⚙ D156130 [Fortran/gfortran] add mechanism to track support for alternate flags. For an up to date status you can check the Disabled tests in https://github.com/llvm/llvm-test-suite/tree/main/Fortran/gfortran.

2 Likes

With respect, that is a hyper-focused view on the current implementation status, not a big picture “what overall points are still outstanding to consider the HLFIR refactoring done” (much less some list of TODOs as would be captured in a tracking issue, milestone, etc.).

Coaxing out some points from your list (obviously this is just for illustration, it shouldn’t be me doing that).

  • HLFIR is at least as correct as FIR
    • Character conversion
    • Parenthesized polymorphic arrays
    • Enable intrinsic ops
  • HLFIR is at least as fast as FIR
    • Investigate performance
    • Fix where necessary
  • HLFIR Testing
    • Re-enable all skipped gfortran tests
    • Test end-to-end with OpenMP
  • Switch default mode of flang to HLFIR
    • Write RFC
    • Do the switch
1 Like

Now that HLFIR is switched on by default, what – if anything – remains to be done for the name switch?

PS. I asked a while ago in the dedicated thread for enabling HLFIR by default, but there was no response.

4 Likes

Yes, it sounds like all the major requirements have been met. I will try to resurrect my original patch and post in on GitHub:

-Andrzej

5 Likes

Is anyone able to report on the current success rate with the gfortran test suite? Please & thank you.

I have noticed that there are several tests that are not being built correctly in the gfortran test suite. I am in the process of fixing those issues (more such patches will follow). I should be able to provide a “more correct” success rate after that.

1 Like

Patch posted on GitHub:

Yes, it sounds like all the major requirements have been met.

Just to clarify - I will wait for a confirmation from @sscalpone before landing this.

Steve, please approve the patch on GitHub once you feel that all the criteria have been met.

Thank you,

-Andrzej

3 Likes

Note that if the renaming is to take place in time for LLVM 18, then there isn’t much time left:

IIUC, we are still waiting for a report on GFortran test-suite pass rate:

@tarunprabhu , any updates?

Btw, due to other commitments, I won’t be able to help with this throughout February. Please feel free to edit/merge/re-use my PR in whatever way that could help progress this.

-Andrzej

1 Like

I have just finished updating the build system for the gfortran tests because they were not generally being built correctly. I can provide an update on the status of flang on the test suite later this week or early next week.

1 Like

Below is a high-level summary of the performance of flang on the gfortran test suite:

Category Count Notes
Total 7878
Viable 7688 Tests that are not excluded on the platform (Linux, x86_64) or explicitly unsupported because of unsupported extensions etc.
Passing 5584
Failing 2104

A rough count of the causes of the failures are provided below. These are deliberately broad categories just so we can get a rough idea of how things stand. Some of the categories disproportionately affect certain categories of tests. For instance, most of the scanning and parsing errors affect the OpenMP and OpenACC tests.

Cause Count Notes
Not yet implemented assertion 858
Segmentation fault 100 These all seemed to be at compile-time. The runtime never segfaulted
Could not scan 22
Could not parse 161
Unknown commandline argument 91 Some of these are limitations with the test suite which will be addressed.
Undeclared identifier 31 These seemed to all be related to C interoperability and something missing in the header.
Undefined reference 34 These seemed to be related to math functions missing from the runtime for the most part
Semantic Errors 239
Linker Error 7 This is due to the -flto not being handled correctly in the test suite.
Runtime error 14 The runtime raised an error
Terminated by signal 4 These are probably timeouts but may be a result of an issue in the runtime
Others 543 These are usually mismatches between the expected and actual test results

I can provide a more detailed breakdown if required at the flang community call.

[EDIT: Fix table header]

4 Likes

Great info, thanks @tarunprabhu .

Follow up question then, is this a sufficient pass rate to justify the name change? If not, what would be?

Thanks Tarun!

I’d like to see the compiler segfaults fixed for sure.

For the others, I’d like us to evaluate bad bug vs. minor issue, e.g. off by 100 or off by 0.0000001, respectively.

Do you have a breakdown by test somewhere? I’m curious about the fail-to-parse as well as the semantic errors.

My test harness is running about 6600 tests. Of those, about 5200 are deemed ok, which means they are passing, not yet implemented, or not applicable to flang for some reason. Most of the remaining tests have not been classified yet.

I don’t have the exact error message corresponding to each test but I can probably get you that if you need it. But here are lists of tests that produce “could not scan” and “could not parse” errors. The paths are relative to Fortran/gfortran/regression in the test suite:

Could not scan

badline.f
bom_UTF-32.f90
bom_UTF16-BE.f90
bom_UTF16-LE.f90
feed_1.f90
feed_2.f90
include_13.f90
openacc-define-3.f90
openmp-define-3.f90
goacc-gomp/free-1.f90
gomp/declare-variant-13.f90
gomp/declare-variant-14.f90
gomp/declare-variant-15.f90
gomp/declare-variant-16.f90
gomp/declare-variant-1.f90
gomp/declare-variant-3.f90
gomp/declare-variant-4.f90
gomp/declare-variant-5.f90
gomp/declare-variant-8.f90
gomp/declare-variant-9.f90
gomp/free-2.f90
gomp/include_1.f

** Could not parse **

d_lines_2.f
dec_d_lines_1.f
fmt_read_3.f90
auto_in_equiv_1.f90
auto_in_equiv_2.f90
automatic_1.f90
dec-comparison-character_1.f90
dec-comparison-character_2.f90
dec_exp_1.f90
dec_format_empty_item_1.f
dec_io_1.f90
dec_parameter_1.f
dec_parameter_2.f90
dec_static_1.f90
dec_static_2.f90
dec_structure_10.f90
dec_structure_5.f90
dec_structure_7.f90
substr_9.f90
goacc-gomp/fixed-1.f
goacc/nested-reductions-1-kernels.f90
goacc/nested-reductions-1-parallel.f90
goacc/nested-reductions-2-kernels.f90
goacc/nested-reductions-2-parallel.f90
goacc/specification-part.f90
gomp/affinity-1.f90
gomp/affinity-clause-1.f90
gomp/affinity-clause-3.f90
gomp/affinity-clause-5.f90
gomp/all-memory-2.f90
gomp/all-memory-3.f90
gomp/assume-1.f90
gomp/assume-3.f90
gomp/assume-4.f90
gomp/atomic-16.f90
gomp/atomic-17.f90
gomp/atomic-19.f90
gomp/atomic-20.f90
gomp/atomic-21.f90
gomp/atomic-25.f90
gomp/atomic.f90
gomp/cancel-3.f90
gomp/clauses-1.f90
gomp/declare-simd-4.f90
gomp/depend-4.f90
gomp/depend-5.f90
gomp/depend-6.f90
gomp/depend-iterator-1.f90
gomp/depobj-1.f90
gomp/error-2.f90
gomp/if-1.f90
gomp/lastprivate-conditional-2.f90
gomp/lastprivate-conditional-3.f90
gomp/lastprivate-conditional-4.f90
gomp/linear-2.f90
gomp/linear-4.f90
gomp/loop-1.f90
gomp/loop-3.f90
gomp/loop-5.f90
gomp/map-6.f90
gomp/map-7.f90
gomp/masked-1.f90
gomp/masked-combined-1.f90
gomp/masked-taskloop.f90
gomp/nothing-1.f90
gomp/nowait-2.f90
gomp/nowait-3.f90
gomp/nowait-5.f90
gomp/nowait-7.f90
gomp/num-teams-1.f90
gomp/num-teams-2.f90
gomp/omp_parse1.f90
gomp/openmp-simd-7.f90
gomp/openmp-simd-8.f90
gomp/order-1.f90
gomp/parallel-master-1.f90
gomp/pr102431.f90
gomp/pr102621.f90
gomp/pr103643.f90
gomp/pr103695.f90
gomp/pr107214-4.f90
gomp/pr77665.f90
gomp/pr99928-11.f90
gomp/pr99928-1.f90
gomp/pr99928-2.f90
gomp/pr99928-3.f90
gomp/pr99928-4.f90
gomp/pr99928-5.f90
gomp/pr99928-6.f90
gomp/pr99928-8.f90
gomp/reduction-task-1.f90
gomp/reduction-task-3.f90
gomp/scan-2.f90
gomp/scan-3.f90
gomp/scan-4.f90
gomp/scan-5.f90
gomp/scope-1.f90
gomp/scope-2.f90
gomp/scope-6.f90
gomp/strictly-structured-block-1.f90
gomp/strictly-structured-block-3.f90
gomp/taskloop-1.f90
gomp/workshare-reduction-10.f90
gomp/workshare-reduction-11.f90
gomp/workshare-reduction-12.f90
gomp/workshare-reduction-13.f90
gomp/workshare-reduction-14.f90
gomp/workshare-reduction-15.f90
gomp/workshare-reduction-16.f90
gomp/workshare-reduction-17.f90
gomp/workshare-reduction-18.f90
gomp/workshare-reduction-19.f90
gomp/workshare-reduction-1.f90
gomp/workshare-reduction-20.f90
gomp/workshare-reduction-21.f90
gomp/workshare-reduction-22.f90
gomp/workshare-reduction-23.f90
gomp/workshare-reduction-24.f90
gomp/workshare-reduction-25.f90
gomp/workshare-reduction-26.f90
gomp/workshare-reduction-27.f90
gomp/workshare-reduction-28.f90
gomp/workshare-reduction-29.f90
gomp/workshare-reduction-2.f90
gomp/workshare-reduction-30.f90
gomp/workshare-reduction-31.f90
gomp/workshare-reduction-32.f90
gomp/workshare-reduction-33.f90
gomp/workshare-reduction-34.f90
gomp/workshare-reduction-35.f90
gomp/workshare-reduction-36.f90
gomp/workshare-reduction-37.f90
gomp/workshare-reduction-38.f90
gomp/workshare-reduction-39.f90
gomp/workshare-reduction-3.f90
gomp/workshare-reduction-40.f90
gomp/workshare-reduction-41.f90
gomp/workshare-reduction-42.f90
gomp/workshare-reduction-43.f90
gomp/workshare-reduction-44.f90
gomp/workshare-reduction-45.f90
gomp/workshare-reduction-46.f90
gomp/workshare-reduction-47.f90
gomp/workshare-reduction-48.f90
gomp/workshare-reduction-49.f90
gomp/workshare-reduction-4.f90
gomp/workshare-reduction-50.f90
gomp/workshare-reduction-51.f90
gomp/workshare-reduction-52.f90
gomp/workshare-reduction-53.f90
gomp/workshare-reduction-54.f90
gomp/workshare-reduction-55.f90
gomp/workshare-reduction-56.f90
gomp/workshare-reduction-57.f90
gomp/workshare-reduction-58.f90
gomp/workshare-reduction-5.f90
gomp/workshare-reduction-6.f90
gomp/workshare-reduction-7.f90
gomp/workshare-reduction-8.f90
gomp/workshare-reduction-9.f90
vect/vect-8.f90