]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: declare runtime bit func aliases after math/bits intrinsics
authorMichael Anthony Knyszek <mknyszek@google.com>
Fri, 20 Mar 2020 15:26:46 +0000 (15:26 +0000)
committerMichael Knyszek <mknyszek@google.com>
Mon, 23 Mar 2020 15:52:57 +0000 (15:52 +0000)
commit830ee4792e52cc8c7c0a4d54259f55fa3629271a
treea1e37edc531e32fb0a53324a8986f5fda1750d70
parentbb929b7452b5b8a6a584a94a110c98b0c6543a6e
cmd/compile: declare runtime bit func aliases after math/bits intrinsics

Currently runtime/internal/sys bit-manipulation functions are aliased to
math/bits functions, which are intrinsified. Unfortunately these aliases
are declared before the intrinsified versions are generated, resulting
in the generic version of the code being copied over.

This change moves the aliases for bit operations in runtime/internal/sys
after the addF calls to generate those intrinsics in SSA, so that the
intrinsified SSA representation of those functions actually get copied
over.

This should improve the overall performance of the runtime (especially
the page allocator) since these bit operations will actually be
intrinsified now.

Change-Id: I4377da13f9a7bb6aee608e50df0297148bf8f806
Reviewed-on: https://go-review.googlesource.com/c/go/+/224437
Run-TryBot: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
src/cmd/compile/internal/gc/ssa.go