Skip to content
Snippets Groups Projects
Commit f959fb38 authored by Keith Randall's avatar Keith Randall Committed by Keith Randall
Browse files

cmd/compile: add anchored version of SP

The SPanchored opcode is identical to SP, except that it takes a memory
argument so that it (and more importantly, anything that uses it)
must be scheduled at or after that memory argument.

This opcode ensures that a LEAQ of a variable gets scheduled after the
corresponding VARDEF for that variable.

This may lead to less CSE of LEAQ operations. The effect is very small.
The go binary is only 80 bytes bigger after this CL. Usually LEAQs get
folded into load/store operations, so the effect is only for pointerful
types, large enough to need a duffzero, and have their address passed
somewhere. Even then, usually the CSEd LEAQs will be un-CSEd because
the two uses are on different sides of a function call and the LEAQ
ends up being rematerialized at the second use anyway.

Change-Id: Ib893562cd05369b91dd563b48fb83f5250950293
Reviewed-on: https://go-review.googlesource.com/c/go/+/452916


TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
Reviewed-by: default avatarMartin Möhrmann <martin@golang.org>
Reviewed-by: default avatarKeith Randall <khr@google.com>
parent 47a0d467
Branches
Tags
No related merge requests found
Showing
with 175 additions and 23 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment