[LLVMdev] Interprocedural Register Allocation

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Oct 4 13:31:57 PDT 2012

On Oct 4, 2012, at 2:47 AM, Madhusudan C.S <madhusudancs at gmail.com> wrote:

> However, I was reading the DeveloperPolicy page and the policy for making major
> changes asks the developers to discuss the work here before proceeding. So, I am
> writing this mail to kickoff a discussion. I would really like to contribute to LLVM and
> I think this is a good place for me to start. Is there something specific like a paper
> that you guys would want me to read before diving in?
> I understand that register allocation itself is a tricky problem and doing an interprocedural
> allocation is extremely hard. But I would like to try, at least try and fail if worst comes
> to worst than not doing anything at all. At least by attempting to implement that, I will
> have a better understanding of LLVM code base which may come in handy to contribute
> to other parts of LLVM.

Interprocedural register allocation means different things to different people. The approach that is described on the open projects page is quite simple; it still runs the register allocator on one function at a time.

I am not aware of any papers describing this simple idea.

Basically, the PrologEpilogInsertion pass will add a bit mask to MachineModuleInfo describing which registers are clobbered by the function being compiled. Later, when compiling the callers, that bit mask is used to initialize the regmask operands on call instructions.

See also TargetRegisterInfo::getCallPreservedMask().


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121004/a85ddfd7/attachment.html>

More information about the llvm-dev mailing list