install and add backend to llvm.

Hi I am new to llvm and Linux (I am using ubuntu 10)

My aim is to add backend to llvm.

I install llvm using

$ sudo apt-get install llvm

and I am able to understand what I read about Writing an LLVM Compiler Backend.

I have seen the assembly codes of the targets on llvm using llc. What I need now is to change some of the TableGen files of one of the target like SparcInstrInfo.td. So I uninstall llvm and I try to build it manually as specified in Getting Started with the LLVM System. http://llvm.org/releases/2.7/docs/GettingStarted.html.

The building finish with out error (I didn\t include LLVM Test Suite).
I use default for all of the options!!

But when I use all of tools for example
$ lli hello.bc

I get

The program ‘lli’ is currently not installed. You can install it by typing:
sudo apt-get install llvm-2.7-runtime

Any help please.

I just need to see the effect of a changes in TableGen files, when i print the assembly code.
like name of register, or name of Instruction.

thanks


|

Have you added the $LLVM_INSTALL_DIR/bin to your PATH environment variable?

Regarding changing a particular backend, check the documentation in
http://llvm.org/docs/WritingAnLLVMBackend.html
http://llvm.org/docs/CodeGenerator.html

A few LLVMdev meetings have good talks to give you a good enough idea.
http://llvm.org/devmtg/

Cheers,
Raghu.

Thanks Raghu

It is working fine now!!!

I change the name of the instruction “add” to “newadd” in
root/llvm/lib/Target/XCore/XCoreInstrInfo.td. Then I go to objllvm/lib/Target/XCore/

then I run

$ make
$ cd
$ cd objllvm
$ sudo make install

I can see the new name *newadd" in the assembly code now but Is this the shortest way?
I mean I change only one file :slight_smile:

thanks again!!!

— On Tue, 1/25/11, Raghu Prabhakar raghu@cs.ucla.edu wrote:


> From: Raghu Prabhakar raghu@cs.ucla.edu
> Subject: Re: [LLVMdev] install and add backend to llvm.
> To: “Teklu kebede” tek_phy@yahoo.com
> Cc: llvmdev@cs.uiuc.edu
> Date: Tuesday, January 25, 2011, 2:51 AM
>
> Have you added the $LLVM_INSTALL_DIR/bin to your PATH environment variable?
>
> Regarding changing a particular backend, check the documentation in
> http://llvm.org/docs/WritingAnLLVMBackend.html
> http://llvm.org/docs/CodeGenerator.html
>
> A few LLVMdev meetings have good talks to give you a good enough idea.
> http://llvm.org/devmtg/
>
> Cheers,
> Raghu.
>
> ----- Original Message -----
> From: “Teklu kebede” tek_phy@yahoo.com
> To: llvmdev@cs.uiuc.edu
> Sent: Monday, January 24, 2011 6:13:37 PM
> Subject: [LLVMdev] install and add backend to llvm.
>
> Hi I am new to llvm and Linux (I am using ubuntu 10)
>
> My aim is to add backend to llvm.
>
> I install llvm using
>
> $ sudo apt-get install llvm
>
> and I am able to understand what I read about Writing an LLVM Compiler Backend.
>
> I have seen the assembly codes of the targets on llvm using llc. What I need now is to change some of the TableGen files of one of the target like SparcInstrInfo.td. So I uninstall llvm and I try to build it manually as specified in Getting Started with the LLVM System. http://llvm.org/releases/2.7/docs/GettingStarted.html.
>
> The building finish with out error (I didn\t include LLVM Test Suite ).
> I use default for all of the options!!
>
> But when I use all of tools for example
> $ lli hello.bc
>
> I get
>
> The program ‘lli’ is currently not installed. You can install it by typing:
> sudo apt-get install llvm-2.7-runtime
>
> Any help please.
>
> I just need to see the effect of a changes in TableGen files, when i print the assembly code.
> like name of register, or name of Instruction.
>
> thanks
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

|