Stub LLVM backend wanted

I'm trying to port LLVM to a new architecture. I'm finding that the
initial bootstrapping stage of getting something which will build, even
if it doesn't work, is complex and rather disheartening --- there's this
huge cliff of difficulty in just getting all the boilerplate laid out
correctly, before getting to the fun stuff. The other backends are of
limited use here because, of course, they're cluttered up with code due
to being real backends.

So: does anyone have a stub backend I can use as a starting point?
Something which only has a few registers, implements no instructions
other than the minimum necessary to actually compile an empty function,
contains no custom optimisation passes, etc. From there I can start
incrementally adding features, testing at each stage.

(In addition, if anyone knows of any docs other than 'Writing an LLVM
backend' (which is very short on detail) or 'Creating an LLVM backend
for the Cpu0 architecture' (which is unfinished), I'd be really
interested...)

I'm trying to port LLVM to a new architecture. I'm finding that the
initial bootstrapping stage of getting something which will build, even
if it doesn't work, is complex and rather disheartening --- there's this
huge cliff of difficulty in just getting all the boilerplate laid out
correctly, before getting to the fun stuff. The other backends are of
limited use here because, of course, they're cluttered up with code due
to being real backends.

So: does anyone have a stub backend I can use as a starting point?
Something which only has a few registers, implements no instructions
other than the minimum necessary to actually compile an empty function,
contains no custom optimisation passes, etc. From there I can start
incrementally adding features, testing at each stage.

I am not aware of any stub backends, but I think this would be very
useful. Especially if you could just do:

sed -i 's/Example/TargetName/g' *

and get something that would build.

Maybe this would make a good GSOC project.

-Tom

Maybe this would make a good GSOC project.

It's definitely too small project for a GSoC.

One can try to start from https://github.com/asl/llvm-openrisc
(openrisc branch inside), however, it's already 2 years old...

Maybe this would make a good GSOC project.

It's definitely too small project for a GSoC.

I dunno. I can tell you from personal experience that it requires a
surprising amount of knowledge of how LLVM backends work --- I'm sure
it's trivial once you've written one, but then, once you've written one,
you don't need it...

One can try to start from https://github.com/asl/llvm-openrisc
(openrisc branch inside), however, it's already 2 years old...

That looks a lot easier to extract the logic from than the in-tree
backends; thanks. Any ideas why this never made it to the tree?

That looks a lot easier to extract the logic from than the in-tree
backends; thanks. Any ideas why this never made it to the tree?

Well... this particular code was used as an example stuff for the talk
at EuroLLVM 2 years ago. You may want to ask OpenRISC folks about the
status of "proper" LLVM backend.