]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: regalloc: handle desired registers of 2-output insns
authorKeith Randall <khr@golang.org>
Sat, 23 Nov 2024 18:58:47 +0000 (10:58 -0800)
committerKeith Randall <khr@golang.org>
Thu, 13 Feb 2025 22:08:07 +0000 (14:08 -0800)
commita0029e95e5d6f15cab70e533d447c75aa4211636
tree50eb120bb865c7446b1c5d31f0ffae303e4e47da
parent20d7c57422143d07f5ef85d674687dbc0a4871ce
cmd/compile: regalloc: handle desired registers of 2-output insns

Particularly with 2-word load instructions, this becomes important.
Classic example is:

    func f(p *string) string {
        return *p
    }

We want the two loads to put the return values directly into
the two ABI return registers.

At this point in the stack, cmd/go is 1.1% smaller.

Change-Id: I51fd1710238e81d15aab2bfb816d73c8e7c207b1
Reviewed-on: https://go-review.googlesource.com/c/go/+/631137
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/compile/internal/ssa/regalloc.go
test/codegen/memcombine.go