On Thu, 3 Aug 2006, Jim Laskey wrote:> To force the load/linking of your register allocator into the llc/lli tools, > add your create function's global declaration to "Passes.h" and add a > "pseudo" call line to "llvm/Codegen/LinkAllCodegenComponents.h" .Another note: with this new functionality you should be able to dynamically load register allocators. Build your register allocator into a dynamic library, like this: http://llvm.org/docs/WritingAnLLVMPass.html#makefile They you should be able to use: llc -load yourregalloc.so -regalloc=yours ... -Chris -- http://nondot.org/sabre/ http://llvm.org/
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? :) On 8/3/06, Chris Lattner <sabre at nondot.org> wrote:> On Thu, 3 Aug 2006, Jim Laskey wrote: > > To force the load/linking of your register allocator into the llc/lli > tools, > > add your create function's global declaration to "Passes.h" and add a > > "pseudo" call line to "llvm/Codegen/LinkAllCodegenComponents.h" . > > Another note: with this new functionality you should be able to > dynamically load register allocators. Build your register allocator into > a dynamic library, like this: > http://llvm.org/docs/WritingAnLLVMPass.html#makefile > > They you should be able to use: > > llc -load yourregalloc.so -regalloc=yours ... > > -ChrisBTW, do you know what the extension cygwin uses instead of ".so"? Thanks, Tony. -- 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/20060820/b3a00b49/attachment.html>
Hi, Op 20-aug-06, om 15:18 heeft Anton Vayvod het volgende geschreven:> 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.Did you add your new folder to the (PARALLEL_)DIRS variable within CodeGen's Makefile?> > llc -load yourregalloc.so -regalloc=yours ... > > -Chris > > BTW, do you know what the extension cygwin uses instead of ".so"?I managed to load a pass without any extension (using opt or llvm- ld), so maybe the following works: llc -load /path/to/yourregalloc - regalloc=... Kind regards, Bram Adams GH-SEL, INTEC, Ghent University
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? :)