M68K codegen target

Hello friends,

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.

There is already patch for it: https://reviews.llvm.org/D50314, but then I was reminded that adding a new backend is not a small thing. So, at this point I require an advice, help or both on how to proceed, and since the patch is quite big I am not sure that a single person would willingly spend time reviewing it entirely.

Kind regards,
Artyom

Hi Artyom,

I made a very brief run over the patch and indeed it is quite large :slight_smile:

Will it be possible to split it to enable better review? For example
I'm seeing you're having some generic codegenerator / TableGen
changes. Will it be possible to separate them out and provide
rationale for them? Going further, probably triple and ELF-related
changes could be also separated out.

Hi Anton,

Thanks for the tip. I’ve moved some common code from the patch:

https://reviews.llvm.org/D50784
https://reviews.llvm.org/D50856
https://reviews.llvm.org/D50858

but the backend itself is still quite large. Anything more I can do to simplify reviewing?

Hi Anton,

Thanks for the tip. I’ve moved some common code from the patch:

⚙ D50784 [TableGen] Add Instruction custom byte sequence emission
⚙ D50856 [TableGen] Add Logical operands info emission
⚙ D50858 [M680x0] Add ELF and Triple info

but the backend itself is still quite large. Anything more I can do to
simplify reviewing?

Personal guess - splitting it further, as much as possible.

I.e. first the minimal infrastructure changes, (what you have posted,
possibly there is more)
then the *absolutely* trimmed down, minimal backend,
then start adding more and more *small* pieces.

It would be time consuming but then the actual review could happen.

Roman.

Has there been any progress on this?

When last I checked, it appeared that the many attempts at a 68K backend for LLVM were all still just prototypes, so I was really excited to learn of this effort today.

I’ll be letting a few other people who still work with 68K know about it too since an LLVM backend has been one of the big missing pieces in retrocomputing communities. (Sure there’s still GCC, but it’s not always a good solution for various reasons. Same with old compilers—lots of modern code just plain won’t work with them, even C code now.)

  -- Chris

AFAICT the problem has always been code ownership - we would need people with some knowledge of both m68k and llvm to be willing to actively support the target: steering it through the setup/experimental target stages, providing (and maintaining) test/buildbot coverage, managing reported bugs, and handling any changes to the llvm APIs that require changes in the backend.

Even if there's a demand for it (and AFAICT from the amiga community alone there definitely is), without real code owners I don't think this will go anywhere.

Simon.