Jakob Stoklund Olesen
2011-Sep-26 14:49 UTC
[LLVMdev] Greedy Register Allocation in LLVM 3.0
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. /jakob
Carlo Alberto Ferraris
2011-Sep-26 17:36 UTC
[LLVMdev] Greedy Register Allocation in LLVM 3.0
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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110926/aba0f7bd/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: cafxx.vcf Type: text/x-vcard Size: 230 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110926/aba0f7bd/attachment.vcf>
Jakob Stoklund Olesen
2011-Sep-27 00:34 UTC
[LLVMdev] Greedy Register Allocation in LLVM 3.0
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. /jakob -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110926/29b303e5/attachment.html>