[LLVMdev] How to construct a new register allocation algorithm
Tim Northover
t.p.northover at gmail.com
Wed May 21 23:33:20 PDT 2014
On 22 May 2014 02:37, 蜡笔小新 <841224078 at qq.com> wrote:
> 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.
More information about the llvm-dev
mailing list