]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: delete unused code and fix typo in comment
authorJun10ng <zeonll@outlook.com>
Mon, 5 Feb 2024 17:12:17 +0000 (17:12 +0000)
committerGopher Robot <gobot@golang.org>
Mon, 5 Feb 2024 20:59:15 +0000 (20:59 +0000)
Change-Id: Ia1f1c7d5563a74950c47cf3ebdcb600b34c83e85
GitHub-Last-Rev: bd58214e5e66e32c0055936820b8f0adf7f388c6
GitHub-Pull-Request: golang/go#65527
Reviewed-on: https://go-review.googlesource.com/c/go/+/561355
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/inline/inl.go
src/cmd/compile/internal/inline/inlheur/analyze.go
src/cmd/compile/internal/inline/inlheur/scoring.go
src/cmd/compile/internal/inline/interleaved/interleaved.go
src/internal/profile/graph.go

index f6f6ad84117d2490643471cfb70dd50d8d69a5e7..3e4c39ed9c1f8ea455431374aadc4ed723a0c8e1 100644 (file)
@@ -78,7 +78,7 @@ var (
 )
 
 // PGOInlinePrologue records the hot callsites from ir-graph.
-func PGOInlinePrologue(p *pgo.Profile, funcs []*ir.Func) {
+func PGOInlinePrologue(p *pgo.Profile) {
        if base.Debug.PGOInlineCDFThreshold != "" {
                if s, err := strconv.ParseFloat(base.Debug.PGOInlineCDFThreshold, 64); err == nil && s >= 0 && s <= 100 {
                        inlineCDFHotCallSiteThresholdPercent = s
@@ -119,7 +119,7 @@ func PGOInlinePrologue(p *pgo.Profile, funcs []*ir.Func) {
 // a percent, is the lower bound of weight for nodes to be considered hot
 // (currently only used in debug prints) (in case of equal weights,
 // comparing with the threshold may not accurately reflect which nodes are
-// considiered hot).
+// considered hot).
 func hotNodesFromCDF(p *pgo.Profile) (float64, []pgo.NamedCallEdge) {
        cum := int64(0)
        for i, n := range p.NamedEdgeMap.ByWeight {
@@ -138,7 +138,7 @@ func hotNodesFromCDF(p *pgo.Profile) (float64, []pgo.NamedCallEdge) {
 // CanInlineFuncs computes whether a batch of functions are inlinable.
 func CanInlineFuncs(funcs []*ir.Func, profile *pgo.Profile) {
        if profile != nil {
-               PGOInlinePrologue(profile, funcs)
+               PGOInlinePrologue(profile)
        }
 
        ir.VisitFuncsBottomUp(funcs, func(list []*ir.Func, recursive bool) {
@@ -227,7 +227,7 @@ func GarbageCollectUnreferencedHiddenClosures() {
 }
 
 // inlineBudget determines the max budget for function 'fn' prior to
-// analyzing the hairyness of the body of 'fn'. We pass in the pgo
+// analyzing the hairiness of the body of 'fn'. We pass in the pgo
 // profile if available (which can change the budget), also a
 // 'relaxed' flag, which expands the budget slightly to allow for the
 // possibility that a call to the function might have its score
@@ -239,7 +239,7 @@ func inlineBudget(fn *ir.Func, profile *pgo.Profile, relaxed bool, verbose bool)
        if profile != nil {
                if n, ok := profile.WeightedCG.IRNodes[ir.LinkFuncName(fn)]; ok {
                        if _, ok := candHotCalleeMap[n]; ok {
-                               budget = int32(inlineHotMaxBudget)
+                               budget = inlineHotMaxBudget
                                if verbose {
                                        fmt.Printf("hot-node enabled increased budget=%v for func=%v\n", budget, ir.PkgFuncName(fn))
                                }
@@ -322,10 +322,9 @@ func CanInline(fn *ir.Func, profile *pgo.Profile) {
        }
 
        n.Func.Inl = &ir.Inline{
-               Cost:    budget - visitor.budget,
-               Dcl:     pruneUnusedAutos(n.Func.Dcl, &visitor),
-               HaveDcl: true,
-
+               Cost:            budget - visitor.budget,
+               Dcl:             pruneUnusedAutos(n.Func.Dcl, &visitor),
+               HaveDcl:         true,
                CanDelayResults: canDelayResults(fn),
        }
        if base.Flag.LowerM != 0 || logopt.Enabled() {
index a1b6f358e17e8eeda955a40da06ebc612b73f653..1fb502ac2abe653c04ebd2710422dc4cc98a4403 100644 (file)
@@ -95,7 +95,7 @@ func AnalyzeFunc(fn *ir.Func, canInline func(*ir.Func), budgetForFunc func(*ir.F
        // only after the closures it contains have been processed, so
        // iterate through the list in reverse order. Once a function has
        // been analyzed, revisit the question of whether it should be
-       // inlinable; if it is over the default hairyness limit and it
+       // inlinable; if it is over the default hairiness limit and it
        // doesn't have any interesting properties, then we don't want
        // the overhead of writing out its inline body.
        nameFinder := newNameFinder(fn)
index 623ba8adf0e41aecb0b90c7fe96d87049d6eefe2..3de95d46b43162abf5f4f84c8f8229965d9a2342 100644 (file)
@@ -590,7 +590,7 @@ func GetCallSiteScore(fn *ir.Func, call *ir.CallExpr) (int, bool) {
 
 // BudgetExpansion returns the amount to relax/expand the base
 // inlining budget when the new inliner is turned on; the inliner
-// will add the returned value to the hairyness budget.
+// will add the returned value to the hairiness budget.
 //
 // Background: with the new inliner, the score for a given callsite
 // can be adjusted down by some amount due to heuristics, however we
@@ -617,7 +617,7 @@ var allCallSites CallSiteTab
 // along with info on call site scoring and the adjustments made to a
 // given score. Here profile is the PGO profile in use (may be
 // nil), budgetCallback is a callback that can be invoked to find out
-// the original pre-adjustment hairyness limit for the function, and
+// the original pre-adjustment hairiness limit for the function, and
 // inlineHotMaxBudget is the constant of the same name used in the
 // inliner. Sample output lines:
 //
@@ -629,7 +629,7 @@ var allCallSites CallSiteTab
 //
 // In the dump above, "Score" is the final score calculated for the
 // callsite, "Adjustment" is the amount added to or subtracted from
-// the original hairyness estimate to form the score. "Status" shows
+// the original hairiness estimate to form the score. "Status" shows
 // whether anything changed with the site -- did the adjustment bump
 // it down just below the threshold ("PROMOTED") or instead bump it
 // above the threshold ("DEMOTED"); this will be blank ("---") if no
index a6f19d470d9895134cd541b5b7f46c3b2c034b27..89560802407405b125ac8de6da39c035eaf256fb 100644 (file)
@@ -39,7 +39,7 @@ func DevirtualizeAndInlinePackage(pkg *ir.Package, profile *pgo.Profile) {
                inlProfile = profile
        }
        if inlProfile != nil {
-               inline.PGOInlinePrologue(inlProfile, pkg.Funcs)
+               inline.PGOInlinePrologue(inlProfile)
        }
 
        ir.VisitFuncsBottomUp(pkg.Funcs, func(funcs []*ir.Func, recursive bool) {
index 88d5311927e13e35ef26d68414bfd87cc75fbe25..0e8e33c1ac4b9b2535cd96a73516d7eaaaf4b5c8 100644 (file)
@@ -12,7 +12,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Package graph represents a pprof profile as a directed graph.
+// Package profile represents a pprof profile as a directed graph.
 //
 // This package is a simplified fork of github.com/google/pprof/internal/graph.
 package profile