cmd/compile: establish regabi name/value mapping for small in-params

When the expand_calls phase in the SSA backend lowers prolog OpArg
values into OpArgIntReg/OpArgFloatReg values, we don't always record
the assocation between the new lowered value and the parameter name.

This patch handles the simple case where a given parameter fits into
exactly one register; in this scenario it makes sense to manufacture a
new pseudo-slot for the value that points to the param, and install
the slot/value mapping in the NamedValues table for the function. More
work will be needed to deal with params that span multiple registers;
that will need to be addressed in a subsequent patch.

This change improves the parameter error rate "optargorder" benchmark
by about 7-8% (when run on the optargorder binary).

Updates #45945.

Change-Id: Ic9adbe20b6f91145d49651348818f0f5cba92b18
Trust: Than McIntosh <>
Run-TryBot: Than McIntosh <>
Reviewed-by: David Chase <>
Reviewed-by: Cherry Zhang <>
TryBot-Result: Go Bot <>
1 file changed
tree: ee5428662b81326356f3320bbf74f1c5cea1d57e
  1. .github/
  2. api/
  3. doc/
  4. lib/
  5. misc/
  6. src/
  7. test/
  8. .gitattributes
  9. .gitignore
  17. codereview.cfg

The Go Programming Language

Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.

Gopher image Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.

Our canonical Git repository is located at There is a mirror of the repository at

Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.

Download and Install

Binary Distributions

Official binary distributions are available at

After downloading a binary release, visit for installation instructions.

Install From Source

If a binary distribution is not available for your combination of operating system and architecture, visit for source installation instructions.


Go is the work of thousands of contributors. We appreciate your help!

To contribute, please read the contribution guidelines at

Note that the Go project uses the issue tracker for bug reports and proposals only. See for a list of places to ask questions about the Go language.