M68K codegen target


A couple years back I’ve started a M68K codegen port of LLVM, and then suspended it
for the lack of free time. Now I finally got some time and willing to continue
working on it. To keep up with LLVM changes I'd like to merge it upstream.

I'm Debian's principal maintainer for the m68k port and I just wanted to say
that an m68k backend for LLVM is one of the few things that are missing for
this port in Debian besides working gccgo support.

Debian on m68k is currently in very good shape and fun to use. It runs on
real hardware such Amigas, Ataris and 68k-Macs as well as emulators such
as Aranym and QEMU, the latter recently received heavy improvements in the
m68k target. The Linux kernel for m68k is actively maintained by multiple
developers and recently even received new drivers for hardware like ethernet
boards and SCSI controllers. The architecture is still very popular among
retro-computing enthusiasts.

So, while it may seem a bit strange at first look to add target support to
LLVM for such an old CPU, it's actually something that many users are looking
forward to and will certainly very actively used within the community in
projects like Debian, NetBSD and the emulation community.

Since I am also working for Rust support for m68k, I am very much looking
forward to see that Artyom is working on this backend!


! In D50858#1234188, @chandlerc wrote:
Before we add yet another experimental backend, I think it is somewhat important to know what the long-term user story is and the long-term maintenance story.

I'd love for some folks already active in the community, and especially actively maintaining parts of backends to have looked at the larger new backend effort here and to be supportive of it going in... Even an experimental backend adds significant maintenance burden on the larger community. We're already struggling to support and integrate the current experimental backends we have, and its not clear they are all on a healthy path to becoming non-experimental. I don't think we want eternally experimental backends, I think we should have a really clear path for backends to become 100% supported or be removed. So far, no one from the community has even commented on the llvm-dev thread for this. I think reviewing or landing patches is premature until these higher-order issues are sorted, which probably best happens on llvm-dev as the individual patches may not be a clear place to have that discussion.

Similarly, we have (and to an extent, continue to have) problems with experimental backends never having bots turned up to keep them tested and working. Is there a plan for build bots here?

I don't want to seem super negative about this particular backend -- I don't know anything about it and assume it is generally a good backend. And I have no opinions in any direction about the target. I also don't want to seem negative about the general idea of growing more backends. I think LLVM *should* be actively pursuing new backends where we have the community support for them.

However, I want to make sure that we actually have the necessary community support. Currently, I don't see any evidence of that community support on llvm-dev. I think that needs to be addressed before investing more energy in patches.

Hi Chandler!

Thanks a lot for your insight. I agree, testing and proper maintenance are crucial for a new backend and I am also very much aware of the responsibilities.

While I cannot vouch that this new backend will be perfectly maintained and issues are always fixed quickly, there is actually a build bot which regularly builds LLVM snapshots on a large number of targets and that is the build infrastructure in Debian.

As you can see here: Buildd status for llvm-toolchain-snapshot (sid) , the latest SVN revision currently built is r340819, so I assume that's pretty new.

You can see the build logs by clicking the green "Installed" or "Build-Attempted" fields respectively. More build logs can be found in the right-most column.

The various branches are also being built regularly:

Buildd status for llvm-toolchain-6.0 (sid)
Buildd status for llvm-toolchain-7 (sid)
Other Linux distributions like Fedora or openSUSE are also providing publicly accessible build logs, although these distributions don't cover as many targets as Debian.

Again, I cannot promise to be the perfect maintainer, but we're doing our best in Debian downstream to find issues as quickly as possible and report them upstream as soon as they show up - and hopefully also help fixing them.

Thanks again for your input!



Thanks for your comment, you have raised some valid questions. Indeed, adding a new backend is no small matter, and the community must be there to support it. I wouldn’t not expect, though, many people rushing for an opportunity to develop/maintain this backend, but the community is there, it is small but it is there.

Previously I worked on this backend almost 24/7 for a few months, currently I have a day job and the best I can guarantee is weekly/bi-weekly updates/maintenance support. Also, there is an experienced compiler engineer willing to help in the backend development and evolution. I’ll bring him up to speed once (if?) the backend lands.

As Adrian mentioned, the build bots and testing is not an issue here and it will be provided as soon as possible.

I understand your concerns regarding long-term strategy for this backend; there is no intention on leaving it half-done. I’ll put as much effort as possible to make it a proper working backend and hopefully, with help from more experienced folks, this goal will be achieved.