<feed xmlns='http://www.w3.org/2005/Atom'>
<title>go/src/cmd/compile/internal/ssa/stackalloc.go, branch makepkg</title>
<subtitle>Fork of Go programming language with my patches.</subtitle>
<id>http://git.kilabit.info/go/atom?h=makepkg</id>
<link rel='self' href='http://git.kilabit.info/go/atom?h=makepkg'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/'/>
<updated>2025-11-12T18:02:27Z</updated>
<entry>
<title>cmd/compile: optimize liveness in stackalloc</title>
<updated>2025-11-12T18:02:27Z</updated>
<author>
<name>Daniel Morsing</name>
<email>daniel.morsing@gmail.com</email>
</author>
<published>2025-11-05T18:33:44Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=4e761b9a181a090ca9ec52916c4aef93c4cbc090'/>
<id>urn:sha1:4e761b9a181a090ca9ec52916c4aef93c4cbc090</id>
<content type='text'>
The stackalloc code needs to run a liveness pass to build the
interference graph between stack slots. Because the values that we need
liveness over is so sparse, we can optimize the analysis by using a path
exploration algorithm rather than a iterative dataflow one

In local testing, this cuts 74.05 ms of CPU time off a build of cmd/compile.

Change-Id: I765ace87d5e8aae177e65eb63da482e3d698bea7
Reviewed-on: https://go-review.googlesource.com/c/go/+/718540
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
Auto-Submit: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Junyang Shao &lt;shaojunyang@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile: use the builtin clear</title>
<updated>2025-04-18T11:21:12Z</updated>
<author>
<name>apocelipes</name>
<email>seve3r@outlook.com</email>
</author>
<published>2025-04-17T07:49:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=8a8efafa8835b646955dd46f4f466d3126e56200'/>
<id>urn:sha1:8a8efafa8835b646955dd46f4f466d3126e56200</id>
<content type='text'>
To simplify the code a bit.

Change-Id: Ia72f576de59ff161ec389a4992bb635f89783540
GitHub-Last-Rev: eaec8216be964418a085649fcca53a042f28ce1a
GitHub-Pull-Request: golang/go#73411
Reviewed-on: https://go-review.googlesource.com/c/go/+/666117
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Michael Pratt &lt;mpratt@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
</entry>
<entry>
<title>cmd/compile: soften type matching when allocating stack slots</title>
<updated>2024-02-29T21:29:41Z</updated>
<author>
<name>khr@golang.org</name>
<email>khr@golang.org</email>
</author>
<published>2024-02-20T18:32:26Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=e93041333150e6b74f931119036156938dcd0925'/>
<id>urn:sha1:e93041333150e6b74f931119036156938dcd0925</id>
<content type='text'>
Currently we use pointer equality on types when deciding whether we can
reuse a stack slot. That's too strict, as we don't guarantee pointer
equality for the same type. In particular, it can vary based on whether
PtrTo has been called in the frontend or not.

Instead, use the type's LinkString, which is guaranteed to both be
unique for a type, and to not vary given two different type structures
describing the same type.

Update #65783

Change-Id: I64f55138475f04bfa30cfb819b786b7cc06aebe4
Reviewed-on: https://go-review.googlesource.com/c/go/+/565436
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Reviewed-by: Matthew Dempsky &lt;mdempsky@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Auto-Submit: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Cuong Manh Le &lt;cuong.manhle.vn@gmail.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile/internal/ssa: replace Frontend.Auto with Func.NewLocal</title>
<updated>2023-09-08T19:09:14Z</updated>
<author>
<name>Matthew Dempsky</name>
<email>mdempsky@google.com</email>
</author>
<published>2023-09-07T05:42:11Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=5d9e0be159f46e6e98313eb66eb3355116c8bb26'/>
<id>urn:sha1:5d9e0be159f46e6e98313eb66eb3355116c8bb26</id>
<content type='text'>
Change-Id: I0858568d225daba1c318842dc0c9b5e652dff612
Reviewed-on: https://go-review.googlesource.com/c/go/+/526519
Auto-Submit: Matthew Dempsky &lt;mdempsky@google.com&gt;
LUCI-TryBot-Result: Go LUCI &lt;golang-scoped@luci-project-accounts.iam.gserviceaccount.com&gt;
Reviewed-by: Keith Randall &lt;khr@google.com&gt;
Reviewed-by: Keith Randall &lt;khr@golang.org&gt;
</content>
</entry>
<entry>
<title>cmd/compile: add cache of sizeable objects so they can be reused</title>
<updated>2022-10-31T21:41:20Z</updated>
<author>
<name>Keith Randall</name>
<email>khr@golang.org</email>
</author>
<published>2022-10-18T23:07:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=68bd383368b5958f8f02c49bc75134a0ef61daec'/>
<id>urn:sha1:68bd383368b5958f8f02c49bc75134a0ef61daec</id>
<content type='text'>
We kind of have this mechanism already, just normalizing it and
using it in a bunch of places. Previously a bunch of places cached
slices only for the duration of a single function compilation. Now
we can reuse slices across a whole compiler run.

Use a sync.Pool of powers-of-two sizes. This lets us use not
too much memory, and avoid holding onto memory we're no longer
using when a GC happens.

There's a few different types we need, so generate the code for it.
Generics would be useful here, but we can't use generics in the
compiler because of bootstrapping.

Change-Id: I6cf37e7b7b2e802882aaa723a0b29770511ccd82
Reviewed-on: https://go-review.googlesource.com/c/go/+/444820
Run-TryBot: Keith Randall &lt;khr@golang.org&gt;
Reviewed-by: Heschi Kreinick &lt;heschi@google.com&gt;
TryBot-Result: Gopher Robot &lt;gobot@golang.org&gt;
Reviewed-by: David Chase &lt;drchase@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile: manage Slot array better</title>
<updated>2021-05-08T17:03:18Z</updated>
<author>
<name>David Chase</name>
<email>drchase@google.com</email>
</author>
<published>2021-04-21T14:55:42Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3'/>
<id>urn:sha1:b38b1b2f9ae710ee2c16a103bb21644f1adbc5d3</id>
<content type='text'>
steals idea from CL 312093

further investigation revealed additional duplicate
slots (equivalent, but not equal), so delete those too.

Rearranged Func.Names to be addresses of slots,
create canonical addresses so that split slots
(which use those addresses to refer to their parent,
and split slots can be further split)
will preserve "equivalent slots are equal".

Removes duplicates, improves metrics for "args at entry".

Change-Id: I5bbdcb50bd33655abcab3d27ad8cdce25499faaf
Reviewed-on: https://go-review.googlesource.com/c/go/+/312292
Trust: David Chase &lt;drchase@google.com&gt;
Run-TryBot: David Chase &lt;drchase@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Mui &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile: make the stack allocator more careful about register args.</title>
<updated>2021-05-03T17:46:12Z</updated>
<author>
<name>David Chase</name>
<email>drchase@google.com</email>
</author>
<published>2021-04-24T01:49:08Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=90ec25773523ac2c5e075f1e5d7519ee08201b8c'/>
<id>urn:sha1:90ec25773523ac2c5e075f1e5d7519ee08201b8c</id>
<content type='text'>
Assignment between input parameters causes them to have more than
one "Name", and running this backwards from names to values can end
up confusing (conflating) parameter spill slots.

Around 105a6e9518, this cases a stack overflow running
go test -race encoding/pem
because two slice parameters spill (incorrectly) into the same
stack slots (in the AB?I-defined parameter spill area).

This also tickles a failure in cue, which turned out to be
easier to isolate.

Fixes #45851.
Updates #40724.

Change-Id: I39c56815bd6abb652f1ccbe83c47f4f373a125c3
Reviewed-on: https://go-review.googlesource.com/c/go/+/313212
Trust: David Chase &lt;drchase@google.com&gt;
Run-TryBot: David Chase &lt;drchase@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile: spill all the parameters around morestack</title>
<updated>2021-04-16T20:12:20Z</updated>
<author>
<name>David Chase</name>
<email>drchase@google.com</email>
</author>
<published>2021-04-16T04:15:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=b6e1c336037e53ae095e84cfed4a312d8fd3ad45'/>
<id>urn:sha1:b6e1c336037e53ae095e84cfed4a312d8fd3ad45</id>
<content type='text'>
former code only spilled those parameters mentioned in code
AT THE REGISTER LEVEL, this caused problems with liveness
sometimes (which worked on whole variables including
aggregates).

Updates #40724.

Change-Id: Ib9fdc50d95d1d2b1f1e405dd370540e88582ac71
Reviewed-on: https://go-review.googlesource.com/c/go/+/310690
Trust: David Chase &lt;drchase@google.com&gt;
Run-TryBot: David Chase &lt;drchase@google.com&gt;
TryBot-Result: Go Bot &lt;gobot@golang.org&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>Revert "cmd/compile: ensure spills of int/float reg args land in abi slots"</title>
<updated>2021-04-09T15:01:13Z</updated>
<author>
<name>David Chase</name>
<email>drchase@google.com</email>
</author>
<published>2021-04-09T14:53:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=6951da56b0ae2cd4250fc1b0350d090aed633ac1'/>
<id>urn:sha1:6951da56b0ae2cd4250fc1b0350d090aed633ac1</id>
<content type='text'>
This reverts CL 308510.

Reason for revert: It breaks "GOEXPERIMENT=regabi,regabiargs ./make.bash"

Change-Id: I553654690ec73120f8a6258dd80623853c430df0
Reviewed-on: https://go-review.googlesource.com/c/go/+/308932
Trust: David Chase &lt;drchase@google.com&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
</entry>
<entry>
<title>cmd/compile: ensure spills of int/float reg args land in abi slots</title>
<updated>2021-04-09T14:33:44Z</updated>
<author>
<name>David Chase</name>
<email>drchase@google.com</email>
</author>
<published>2021-04-07T13:58:02Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/go/commit/?id=a690a5d75fee3b23e9ab80bd7b48cafb52ce4615'/>
<id>urn:sha1:a690a5d75fee3b23e9ab80bd7b48cafb52ce4615</id>
<content type='text'>
We noticed a while ago that register argument spills were not always
landing where they should.

Updates #40724.

Change-Id: I0b7c3279a2f6270577481c252bae4568cbb6e796
Reviewed-on: https://go-review.googlesource.com/c/go/+/308510
Trust: David Chase &lt;drchase@google.com&gt;
Run-TryBot: David Chase &lt;drchase@google.com&gt;
Reviewed-by: Cherry Zhang &lt;cherryyz@google.com&gt;
</content>
</entry>
</feed>
