Skip to content

Commit 6076edc

Browse files
Jun10nggopherbot
authored andcommitted
cmd/compile: delete unused code and fix typo in comment
Change-Id: Ia1f1c7d5563a74950c47cf3ebdcb600b34c83e85 GitHub-Last-Rev: bd58214 GitHub-Pull-Request: #65527 Reviewed-on: https://go-review.googlesource.com/c/go/+/561355 Auto-Submit: Matthew Dempsky <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> TryBot-Result: Gopher Robot <[email protected]>
1 parent b39ec94 commit 6076edc

File tree

5 files changed

+14
-15
lines changed

5 files changed

+14
-15
lines changed

src/cmd/compile/internal/inline/inl.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var (
7878
)
7979

8080
// PGOInlinePrologue records the hot callsites from ir-graph.
81-
func PGOInlinePrologue(p *pgo.Profile, funcs []*ir.Func) {
81+
func PGOInlinePrologue(p *pgo.Profile) {
8282
if base.Debug.PGOInlineCDFThreshold != "" {
8383
if s, err := strconv.ParseFloat(base.Debug.PGOInlineCDFThreshold, 64); err == nil && s >= 0 && s <= 100 {
8484
inlineCDFHotCallSiteThresholdPercent = s
@@ -119,7 +119,7 @@ func PGOInlinePrologue(p *pgo.Profile, funcs []*ir.Func) {
119119
// a percent, is the lower bound of weight for nodes to be considered hot
120120
// (currently only used in debug prints) (in case of equal weights,
121121
// comparing with the threshold may not accurately reflect which nodes are
122-
// considiered hot).
122+
// considered hot).
123123
func hotNodesFromCDF(p *pgo.Profile) (float64, []pgo.NamedCallEdge) {
124124
cum := int64(0)
125125
for i, n := range p.NamedEdgeMap.ByWeight {
@@ -138,7 +138,7 @@ func hotNodesFromCDF(p *pgo.Profile) (float64, []pgo.NamedCallEdge) {
138138
// CanInlineFuncs computes whether a batch of functions are inlinable.
139139
func CanInlineFuncs(funcs []*ir.Func, profile *pgo.Profile) {
140140
if profile != nil {
141-
PGOInlinePrologue(profile, funcs)
141+
PGOInlinePrologue(profile)
142142
}
143143

144144
ir.VisitFuncsBottomUp(funcs, func(list []*ir.Func, recursive bool) {
@@ -227,7 +227,7 @@ func GarbageCollectUnreferencedHiddenClosures() {
227227
}
228228

229229
// inlineBudget determines the max budget for function 'fn' prior to
230-
// analyzing the hairyness of the body of 'fn'. We pass in the pgo
230+
// analyzing the hairiness of the body of 'fn'. We pass in the pgo
231231
// profile if available (which can change the budget), also a
232232
// 'relaxed' flag, which expands the budget slightly to allow for the
233233
// 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)
239239
if profile != nil {
240240
if n, ok := profile.WeightedCG.IRNodes[ir.LinkFuncName(fn)]; ok {
241241
if _, ok := candHotCalleeMap[n]; ok {
242-
budget = int32(inlineHotMaxBudget)
242+
budget = inlineHotMaxBudget
243243
if verbose {
244244
fmt.Printf("hot-node enabled increased budget=%v for func=%v\n", budget, ir.PkgFuncName(fn))
245245
}
@@ -322,10 +322,9 @@ func CanInline(fn *ir.Func, profile *pgo.Profile) {
322322
}
323323

324324
n.Func.Inl = &ir.Inline{
325-
Cost: budget - visitor.budget,
326-
Dcl: pruneUnusedAutos(n.Func.Dcl, &visitor),
327-
HaveDcl: true,
328-
325+
Cost: budget - visitor.budget,
326+
Dcl: pruneUnusedAutos(n.Func.Dcl, &visitor),
327+
HaveDcl: true,
329328
CanDelayResults: canDelayResults(fn),
330329
}
331330
if base.Flag.LowerM != 0 || logopt.Enabled() {

src/cmd/compile/internal/inline/inlheur/analyze.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func AnalyzeFunc(fn *ir.Func, canInline func(*ir.Func), budgetForFunc func(*ir.F
9595
// only after the closures it contains have been processed, so
9696
// iterate through the list in reverse order. Once a function has
9797
// been analyzed, revisit the question of whether it should be
98-
// inlinable; if it is over the default hairyness limit and it
98+
// inlinable; if it is over the default hairiness limit and it
9999
// doesn't have any interesting properties, then we don't want
100100
// the overhead of writing out its inline body.
101101
nameFinder := newNameFinder(fn)

src/cmd/compile/internal/inline/inlheur/scoring.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ func GetCallSiteScore(fn *ir.Func, call *ir.CallExpr) (int, bool) {
590590

591591
// BudgetExpansion returns the amount to relax/expand the base
592592
// inlining budget when the new inliner is turned on; the inliner
593-
// will add the returned value to the hairyness budget.
593+
// will add the returned value to the hairiness budget.
594594
//
595595
// Background: with the new inliner, the score for a given callsite
596596
// can be adjusted down by some amount due to heuristics, however we
@@ -617,7 +617,7 @@ var allCallSites CallSiteTab
617617
// along with info on call site scoring and the adjustments made to a
618618
// given score. Here profile is the PGO profile in use (may be
619619
// nil), budgetCallback is a callback that can be invoked to find out
620-
// the original pre-adjustment hairyness limit for the function, and
620+
// the original pre-adjustment hairiness limit for the function, and
621621
// inlineHotMaxBudget is the constant of the same name used in the
622622
// inliner. Sample output lines:
623623
//
@@ -629,7 +629,7 @@ var allCallSites CallSiteTab
629629
//
630630
// In the dump above, "Score" is the final score calculated for the
631631
// callsite, "Adjustment" is the amount added to or subtracted from
632-
// the original hairyness estimate to form the score. "Status" shows
632+
// the original hairiness estimate to form the score. "Status" shows
633633
// whether anything changed with the site -- did the adjustment bump
634634
// it down just below the threshold ("PROMOTED") or instead bump it
635635
// above the threshold ("DEMOTED"); this will be blank ("---") if no

src/cmd/compile/internal/inline/interleaved/interleaved.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func DevirtualizeAndInlinePackage(pkg *ir.Package, profile *pgo.Profile) {
3939
inlProfile = profile
4040
}
4141
if inlProfile != nil {
42-
inline.PGOInlinePrologue(inlProfile, pkg.Funcs)
42+
inline.PGOInlinePrologue(inlProfile)
4343
}
4444

4545
ir.VisitFuncsBottomUp(pkg.Funcs, func(funcs []*ir.Func, recursive bool) {

src/internal/profile/graph.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
// Package graph represents a pprof profile as a directed graph.
15+
// Package profile represents a pprof profile as a directed graph.
1616
//
1717
// This package is a simplified fork of github.com/google/pprof/internal/graph.
1818
package profile

0 commit comments

Comments
 (0)