Fernando Magno Quintao Pereira
2006-Aug-20 18:13 UTC
[LLVMdev] Adding register allocator to LLVM
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? :)
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>
Hi all! I didn't manage to link my regalloc to lli (I added USEDLIBS to its makefile). Without it I can't run tests cause they need lli to be built. So how can I link createMyRegisterAllocator function to lli? Thanks. On 8/22/06, Anton Vayvod <avayvod at gmail.com> wrote:> > 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? >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20060902/8f01ff65/attachment.html>