return funcProps
}
+// RevisitInlinability revisits the question of whether to continue to
+// treat function 'fn' as an inline candidate based on the set of
+// properties we've computed for it. If (for example) it has an
+// initial size score of 150 and no interesting properties to speak
+// of, then there isn't really any point to moving ahead with it as an
+// inline candidate.
+func RevisitInlinability(fn *ir.Func, budgetForFunc func(*ir.Func) int32) {
+ if fn.Inl == nil {
+ return
+ }
+ entry, ok := fpmap[fn]
+ if !ok {
+ //FIXME: issue error?
+ return
+ }
+ mxAdjust := int32(largestScoreAdjustment(fn, entry.props))
+ budget := budgetForFunc(fn)
+ if fn.Inl.Cost+mxAdjust > budget {
+ fn.Inl = nil
+ }
+}
+
// computeFuncProps examines the Go function 'fn' and computes for it
// a function "properties" object, to be used to drive inlining
// heuristics. See comments on the FuncProps type for more info.