Creating a new project using LLVM

Hello all,

I was doing some research on LLVM register allocator. I need to test my modification of the register allocator by using some test benchmarks.(Say I am using the gzip as a test program.) How can I make the whole gzip program using LLVM?

I read the “LLVM Makefile Guide” documentation but still not clear about how to modify the makefile of the gzip.

Z.Wu
|

Hi Z.Wu,

I was doing some research on LLVM register allocator. I need to test my
modification of the register allocator by using some test benchmarks.(Say I am
using the gzip as a test program.) How can I make the whole gzip program using
LLVM?

to compile C code like gzip, you need to use an LLVM front-end like clang or
dragonegg. Probably you should compile to LLVM bitcode, for example using
"-c -O2 -emit-llvm" with clang. You can then compile that to assembler
using an unmodified llc, and an llc that incorporates your changes.

Ciao, Duncan.

Hi Sands,


Thanks for you timely reply. :slight_smile:


I tried to compile the C files into LLVM bitcode and then compile then using llc. But can I use this method to compile a group of files(with dependencies)? Because the gzip files I downloaded has a bunch of source code and it uses a makefile to compile/install.


Z. Wu

12年6月27日,周三, Duncan Sands baldrick@free.fr 写道:


> 发件人: Duncan Sands baldrick@free.fr
> 主题: Re: [LLVMdev] Creating a new project using LLVM
> 收件人: llvmdev@cs.uiuc.edu
> 日期: 2012年6月27日,周三,下午3:41
>
> Hi Z.Wu,
>
> > I was doing some research on LLVM register allocator. I need to test my
> > modification of the register allocator by using some test benchmarks.(Say I am
> > using the gzip as a test program.) How can I make the whole gzip program using
> > LLVM?
>
> to compile C code like gzip, you need to use an LLVM front-end like clang or
> dragonegg. Probably you should compile to LLVM bitcode, for example using
> “-c -O2 -emit-llvm” with clang. You can then compile that to assembler
> using an unmodified llc, and an llc that incorporates your changes.
>
> Ciao, Duncan.
>
> > I read the “LLVM Makefile Guide” documentation but still not clear about how to
> > modify the makefile of the gzip.
> >
> > Z.Wu
> >
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
> >
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

|

I tried to compile the C files into LLVM bitcode and then compile then using
llc. But can I use this method to compile a group of files(with dependencies)?
Because the gzip files I downloaded has a bunch of source code and it uses a
makefile to compile/install.

  Replacing CC in the Makefile from gcc to clang/dragonegg should do the trick.

Regards,
chenwj