Skip to content

cmd/compile: allow inlining of open-coded defer calls #38471

@prattmic

Description

@prattmic

Inlining happens before SSA conversion, while open-coded defers happen after, thus the open-coded deferred call can never be inlined. It would be nice to fix this.

@danscales:

It definitely is not trivial, since inlining happens before SSA conversion, whereas there are a bunch of reasons why at least some of the open-coded defer work have to be done during SSA conversion. Among other things, we need to force storing defer args to stack slots and keeping those stacks slots live even though they sometimes appear to be dead (but are actually needed to run the open-coded defers when there is a panic).

@randall77 @aclements

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions