From fbf9076ee8c8f665f1e8bba08fdc473cc7a2d690 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Tue, 11 Jul 2023 10:34:48 -0400 Subject: [PATCH] internal/goexperiment: add "NewInliner" experiment Add "NewInliner" to the list of Go experiments, used for enabling an updated/improved version of the function inlining phase within the Go compiler. Updates #61502. Change-Id: I3218b3ae59a2d05156e8017cd9ee1d7b66cad031 Reviewed-on: https://go-review.googlesource.com/c/go/+/511555 TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky Run-TryBot: Than McIntosh --- src/internal/goexperiment/exp_newinliner_off.go | 13 +++++++++++++ src/internal/goexperiment/exp_newinliner_on.go | 13 +++++++++++++ src/internal/goexperiment/flags.go | 4 ++++ 3 files changed, 30 insertions(+) create mode 100644 src/internal/goexperiment/exp_newinliner_off.go create mode 100644 src/internal/goexperiment/exp_newinliner_on.go diff --git a/src/internal/goexperiment/exp_newinliner_off.go b/src/internal/goexperiment/exp_newinliner_off.go new file mode 100644 index 0000000000000..27bdec3e2de29 --- /dev/null +++ b/src/internal/goexperiment/exp_newinliner_off.go @@ -0,0 +1,13 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated by mkconsts.go. DO NOT EDIT. + +//go:build !goexperiment.newinliner +// +build !goexperiment.newinliner + +package goexperiment + +const NewInliner = false +const NewInlinerInt = 0 diff --git a/src/internal/goexperiment/exp_newinliner_on.go b/src/internal/goexperiment/exp_newinliner_on.go new file mode 100644 index 0000000000000..099e4e5caae16 --- /dev/null +++ b/src/internal/goexperiment/exp_newinliner_on.go @@ -0,0 +1,13 @@ +// Copyright 2023 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Code generated by mkconsts.go. DO NOT EDIT. + +//go:build goexperiment.newinliner +// +build goexperiment.newinliner + +package goexperiment + +const NewInliner = true +const NewInlinerInt = 1 diff --git a/src/internal/goexperiment/flags.go b/src/internal/goexperiment/flags.go index ae3cbaf89fa5d..f767cfa45d5bc 100644 --- a/src/internal/goexperiment/flags.go +++ b/src/internal/goexperiment/flags.go @@ -109,4 +109,8 @@ type Flags struct { // CacheProg adds support to cmd/go to use a child process to implement // the build cache; see https://github.com/golang/go/issues/59719. CacheProg bool + + // NewInliner enables a new+improved version of the function + // inlining phase within the Go compiler. + NewInliner bool }