[LLVMdev] Adding register allocator to LLVM

Anton Vayvod avayvod at gmail.com
Tue Aug 22 10:52:53 PDT 2006


I managed to link my RegAlloc.a library to llc tool but can;t make the
same with lli tool.

Should I use USEDLIBS variable in lli makefile (like llc) or there is
another way?


On 8/20/06, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote:
>
>
> Dear Anton,
>
>    you can add your register allocator strait iin the
> "lib/CodeGen/Passes.cpp", and then 're-make' it: "makellvm llc", on the
> top of lib/CodeGen. It is faster than running make from LLVMOBJDIR. The
> problem is that it only add to llc the changes on the lib/CodeGen
> directory. If you change other parts, a make from LLVMOBJDIR will
> synchronize it.
>
> Try adding code like this to your Passes.cpp file:
>
>
> //===---------------------------------------------------------------------===//
> ///
> /// RegAlloc command line options.
> ///
>
> //===---------------------------------------------------------------------===//
> namespace {
> cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
>          RegisterPassParser<RegisterRegAlloc> >
> RegAlloc("regalloc",
>           cl::init(&createChordalRegisterAllocator),
>           cl::desc("Register allocator to use: (default = chordal)"));
> }
>
> All the best,
>
> Fernando
>
> > Hi!
> >
> > I've did what Jim Laskey wrote but llc didn't reckognize my regalloc
> option.
> >
> > So I moved my allocator implementation into seperate folder within
> CodeGen
> > and wrote separate makefile for it (like in "Writing an LLVM pass"
> > tutorial). But when I run "make" from LLVMOBJDIR it doesn't enter the
> > RegAlloc directory and when linking llc an error like
> > "createGraphColoringRegAlloc not defined" occurs.
> >
> > What am I doing wrong? :)
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
Nae king! Nae quin! Nae laird! Nae master! We willnae be fooled again!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060822/43daee34/attachment.html>


More information about the llvm-dev mailing list