[LLVMdev] Greedy Register Allocation in LLVM 3.0

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Sep 26 17:34:40 PDT 2011

On Sep 26, 2011, at 10:36 AM, Carlo Alberto Ferraris wrote:

> Il 26/09/2011 16:49, Jakob Stoklund Olesen ha scritto:
>> On Sep 26, 2011, at 2:41 AM, 陳韋任 wrote:
>>>> The greedy allocator is global, but so was the old linear scan allocator.
>>>  In http://blog.llvm.org/2011/09/greedy-register-allocation-in-llvm-30.html
>>> , it says "The algorithm is local, and it cannot clean up messes that
>>> extend beyond a single basic block". Does it mean the rewriter algorithm
>>> not the linear scan?
>> Yes, exactly.  The rewriter is local.
> So, does this mean that different BBs may expect the same spilled value to be in different stack slots?

No, the stack slot is assigned before a live range is spilled, so it uses the same stack slot everywhere. The rewriter is mostly eliminating multiple loads from the same stack slot in a basic block.

But that was the old complicated rewriter. The new rewriter used by greedy is completely trivial. It doesn't know anything about stack slots. It has only one optimization: Eliminate identity copies.


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

More information about the llvm-dev mailing list