New backend

Hello devs,

I'd like to ask for some advise about adding a backend. I followed
the steps at http://llvm.org/docs/WritingAnLLVMBackend.html (also
adding the backend to the configure script, so it compiles (on Linux)
with LLVM 3.1.

However, llvm-build fails with:

llvm[0]: Constructing LLVMBuild project information.
Usage: llvm-build [options]

llvm-build: error: invalid target to enable: 'Foo' (not in project)

and since the to be generated LibraryDependencies.inc is missing
llvm-config doesn't build.

Am I missing something?

Regards,
Mario

Hi Mario,

It looks like you didn't add your target to the list of targets in lib/Target/LLVMBuild.txt.

Ivan

Hello

I'd like to ask for some advise about adding a backend. I followed
the steps at http://llvm.org/docs/WritingAnLLVMBackend.html (also
adding the backend to the configure script, so it compiles (on Linux)
with LLVM 3.1.

This document is heavily out of date (so, I think it should be removed
/ marked obsolete).

You might grab some information from
http://llvm.org/devmtg/2012-04-12/Slides/Workshops/Anton_Korobeynikov.pdf
and around.

Hi,

Looks like adding LLVMBuild.txt to lib/Target/Foo and all
sub-directories did the trick. It's still compiling...

Thanks Anton and Ivan.

Hello,

You might grab some information from
http://llvm.org/devmtg/2012-04-12/Slides/Workshops/Anton_Korobeynikov.pdf
and around.

Maybe it’s a good idea to add ‘stub’ backend to the tree

Are there any plans to this?
I'd like to see a 'stub' backend in the llvm-tree (or somewhere else).

Maybe it’s a good idea to add ‘stub’ backend to the tree

Are there any plans to this?
I'd like to see a 'stub' backend in the llvm-tree (or somewhere else).

Well, I asked on the list previously, but noone ever responded....

For the record, I think this would be a great idea, and I’m willing to help, but I don’t currently have time to be the primary author.

-Hal

Sent from my Verizon Wireless Droid

Don't targets like MSP430 and MBlaze serve as good stubs?

/jakob

For the record, I think this would be a great idea, and I'm willing to help,
but I don't currently have time to be the primary author.

Well, just to clarify - I do already have such stub backend - the
first commit of OpenRISC example one, so, it's only matter of few
hours work...

Are there any plans to this?
I'd like to see a 'stub' backend in the llvm-tree (or somewhere else).

Well, I asked on the list previously, but noone ever responded….

Don't targets like MSP430 and MBlaze serve as good stubs?

It's a good question... I think people are looking for something
minimal, so they already know that there are no "unnecessary" stuff...

FWIW, I think a stub backend would be enormously useful.

This document is heavily out of date (so, I think it should be removed
/ marked obsolete).

This is very unfortunate. Are there plans to correct the situation?
"building a backend" is a pretty important piece of documentation for
a compiler framework and deserves to be kept up to date.

--Sean Silva

I think that you need two things:

  1. A direct-as-possible mapping in between the DAG and the stub backend instructions

  2. The features of the backend are all configurable (legal datatypes and instructions, what is promoted to what, etc.) so that we can test as much of the legalizer’s parameter space as possible.

-Hal

Sent from my Verizon Wireless Droid