package inline

import "cmd/compile/internal/inline"

Index

Variables

var InlineCall = func(call *ir.CallExpr, fn *ir.Func, inlIndex int) *ir.InlinedCallExpr {
	base.Fatalf("inline.InlineCall not overridden")
	panic("unreachable")
}

InlineCall allows the inliner implementation to be overridden. If it returns nil, the function will not be inlined.

var SSADumpInline = func(*ir.Func) {}

SSADumpInline gives the SSA back end a chance to dump the function when producing output for debugging the compiler itself.

Functions

func CalleeEffects

func CalleeEffects(init *ir.Nodes, callee ir.Node)

CalleeEffects appends any side effects from evaluating callee to init.

func CanInline

func CanInline(fn *ir.Func, profile *pgo.Profile)

CanInline determines whether fn is inlineable. If so, CanInline saves copies of fn.Body and fn.Dcl in fn.Inl. fn and fn.Body will already have been typechecked.

func InlineCalls

func InlineCalls(fn *ir.Func, profile *pgo.Profile)

InlineCalls/inlnode walks fn's statements and expressions and substitutes any calls made to inlineable functions. This is the external entry point.

func InlineDecls

func InlineDecls(p *pgo.Profile, decls []ir.Node, doInline bool)

InlineDecls applies inlining to the given batch of declarations.

func InlineImpossible

func InlineImpossible(fn *ir.Func) string

InlineImpossible returns a non-empty reason string if fn is impossible to inline regardless of cost or contents.

func InlinePackage

func InlinePackage(p *pgo.Profile)

InlinePackage finds functions that can be inlined and clones them before walk expands them.

Source Files

inl.go

Version
v1.21.12
Published
Jun 27, 2024
Platform
linux/amd64
Imports
11 packages
Last checked
58 seconds ago

Tools for package owners.