Skip to content
Snippets Groups Projects
Commit ec7d955a authored by Rhys Hiltner's avatar Rhys Hiltner Committed by Gopher Robot
Browse files

cmd/compile/internal/test: verify inlining for mutex fast paths

Change-Id: I17568a898ea8514c7b32d2f48c44365ae37cf898
Reviewed-on: https://go-review.googlesource.com/c/go/+/670195


LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: default avatarCherry Mui <cherryyz@google.com>
Auto-Submit: Rhys Hiltner <rhys.hiltner@gmail.com>
Reviewed-by: default avatarMichael Knyszek <mknyszek@google.com>
parent 0c15d889
No related branches found
No related tags found
No related merge requests found
...@@ -284,6 +284,25 @@ func TestIntendedInlining(t *testing.T) { ...@@ -284,6 +284,25 @@ func TestIntendedInlining(t *testing.T) {
} }
} }
if runtime.GOARCH != "wasm" {
// mutex implementation for multi-threaded GOARCHes
want["runtime"] = append(want["runtime"],
// in the fast paths of lock2 and unlock2
"key8",
"(*mLockProfile).store",
)
if bits.UintSize == 64 {
// these use 64-bit arithmetic, which is hard to inline on 32-bit platforms
want["runtime"] = append(want["runtime"],
// in the fast paths of lock2 and unlock2
"mutexSampleContention",
// in a slow path of lock2, but within the critical section
"(*mLockProfile).end",
)
}
}
// Functions that must actually be inlined; they must have actual callers. // Functions that must actually be inlined; they must have actual callers.
must := map[string]bool{ must := map[string]bool{
"compress/flate.byLiteral.Len": true, "compress/flate.byLiteral.Len": true,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment