Hi all,
Happy new year!
I would like to propose promoting the LoongArch
backend from its current
experimental
status to official
before release/16.x
branch is created.
This means that the LoongArch
backend will be built by default and included in
standard binary distributions of LLVM/Clang.
Status
LoongArch
is a RISC style ISA designed by Loongson Technology in China. It has
32- and 64-bit variants and it is composed of a basic part and four extensions.
Various products (e.g. laptops, desktops, workstations, servers) powered by
LoongArch
are being sold on regular shops. A large number of basic software
communities including Linux
, GCC
, Binutils
, Glibc
and Golang
have
released their versions support LoongArch
.
A year ago, I sent a RFC proposing adding LoongArch
backend to LLVM. Now I
think it is mature enough to be moved out of experimental
. Some bases:
- Small tests (e.g.
.s
,.ll
,.mir
,.c
) were written when we submitted each
non-NFC patch. -
check-all
andtest-suite
100% pass without errors. -
A buildbot was connected to the staging area. This bot builds
(-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=LoongArch
and
-DLLVM_ENABLE_PROJECTS=clang
) and testscheck-all
/test-suite
with-j32
on aLoongArch
machine natively. It has been green (except
occasional broken builds caused by problematic patches) for more than 10
days. There have been some pink mark failures caused by network
connection problems. Now we have solved the network issues, and the bot
become relatively stable. - LLVM/Clang-16 is able to build many large programs for
LoongArch
, e.g.
Gcc, Binutils, Linux, Chromium, FFMpeg, SPECCPU, etc. - In addition to
clang
, a good part of others subprojects have been ported to
LoongArch
. For example,check-unwind
andcheck-openmp
100% pass.
Most components ofcompiler-rt
are ready to use and more patches are
under review (D140690, D140528, D139686, D140727). Basic functions of
lldb
are also avialable and a few more patches are under review (D140386,
D140759, D140615). @xen0n has basically completed thelld
support
which is under review (D138135) and he plans to add extensive test coverage
recently.
I believe that we are ready to flip the switch towards an official
target. At
Loongson
, we’re ready to address any issues that arise, and as noted below
we’re delighted that there’s a growing community of contributors around this
backend.
Thanks
I’d like to thank everyone who submitted reviews or patches, helped with setting
up buildbot. Beside the LLVM toolchain team at Loongson
, there are many
names outside to mention. @rengolin, @xen0n, @MaskRay, @xry111,
@myhsu, @lrzlin, @gkistanova, @DavidSpickett, @prcups. I’m sorry if a name is missing.
End
Although becoming an official backend would be a huge milestone, of course it’s
far from the end of the road. We’ll be continuing to work on generated code
performance improvements, ISA extensions support, setting up more buildbots,
working with language communities like Rust, support for additional LLVM
features, etc.
What do you think? Any comments would be appreciated.
Regards,
Weining