How to construct a new register allocation algorithm

There are three main register allocation strategies in the backend of LLVM. If I want to design and implement a new algorithm, how can I add it to LLVM and call it from llc just as the three options like

llc -regalloc=fast file.bc -o fa.s
llc -regalloc=new file.bc -o new.s

There are three main register allocation strategies in the backend of LLVM.
If I want to design and implement a new algorithm, how can I add it to LLVM
and call it from llc just as the three options like

It's probably easiest to copy one of the existing allocators and
replace its code with yours. For example lib/CodeGen/RegAllocBasic.cpp
is the smallest.

llc -regalloc=fast file.bc -o fa.s

This particular option seems to be handled by the "RegisterRegAlloc"
declarations in each file.

Cheers.

Tim.

Just out curiosity, have you implemented a new register allocation algorithm
and if so, which one? I'm working on code generator right now and I'm
looking for a simple register allocation algorithm to implement and how to
deal with fixed registers to cetain instructions like eax/ebx to mul/div on
x86. I've asked this before
(http://llvm.1065342.n5.nabble.com/How-do-I-deal-with-fixed-registers-td68697.html)
but no one asnwered yet.