It's not a fancy algorithm. It tries to layout blocks connected by 
high-likelihood edges together. It also tries to keep panic paths at the 
end.
I don't know of any documentation for it, other than the code.

There's nothing particularly important in the layout pass to help with 
register allocation. It helps a linear-scan allocator to have blocks 
connected by high-likelihood edges be adjacent. But that layout is 
independently useful to avoid branch instructions, and non-linear-scan 
allocators probably like that layout also.

On Tuesday, July 21, 2020 at 4:05:26 AM UTC-7 eric...@arm.com wrote:

> Hi,
> I was looking at the layout pass recently, but I didn't find any documents 
> about it. I would like to ask what algorithm is used for this pass? There 
> is not much code for this pass, but if there is some documentation, it will 
> be more convenient to understand it.
>
> The layout pass has something to do with register allocation. I know that 
> register allocation uses linear scan algorithm. If anyone could tell me a 
> document, presentation or blog describing its implementation, I would be 
> very grateful.
>
> Thanks
> Eric
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c7f903ce-990a-4286-8896-d3220fc82303n%40googlegroups.com.

Reply via email to