1

I am getting familiar myself to LLVM, and my goal is to implement a back-end for my custom processor. Before I jump into my back-end implementation, I first try to learn how a build procedure works, so I first copy lib/Target/MSP430 to lib/Target/myproc, and build llvm targeting "myproc" (even though it actually is a back-end for MSP430, I did this just to learn how I can add a new target to LLVM).

When I configure/make llvm, I got the following error message.


...

/bin/cp: cannot stat `/mydir/build/lib/Target/myproc/Debug+Asserts/MSP430GenRegisterInfo.inc.tmp': No such file or directory

...


I checked /lib/Target/myproc, and saw there was only one file, Makefile, copied from /lib/Target/myproc.

Here is what I have done before I configure and make.

  1. In my LLVM source directory, copy lib/Target/MSP430 to lib/Target/myproc.
  2. Modify configure and projects/sample/configure to add "myproc".
  3. Go to lib/Target/myproc and change "MSP430" to "myproc" in MSP430.td, LLVMBuild.txt, and Makefile (I also modify the files in subdirectories).

As the LLVM compile works for other targets on my machine, I believe it's not the problem of machine of tools that I am using, but the problem of my modification.

Am I missing something? Are there any further modifications that I am supposed to make?

1 Answer 1

0

There's a decent tutorial for writing backends here:

http://llvm.org/docs/WritingAnLLVMBackend.html

There's also this tutorial from a dev meeting:

http://llvm.org/devmtg/2012-04-12/Slides/Workshops/Anton_Korobeynikov.pdf

*GenRegisterInfo.inc comes from running tblgen on the target .td file. The .inc output file name depends on what the .td files are named in the myproc/ target directory.

It would be helpful to see more of your make log but my guess is that you're getting a tblgen error when processing .td files in myproc/. That tblgen error is the real problem you need to diagnose and address.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.