Skip to content

better code generated for async functions which are never called with async #3064

@andrewrk

Description

@andrewrk

if an async function is never called with async then a few optimizations can be made:

  • the return does not need to be atomic
  • it can be assumed that these are always available: the awaiter ptr, return ptr if applicable,
    error return trace ptr if applicable.
  • it can be assumed that it is never cancelled zig no longer has cancellation, but if it were reintroduced, this would be relevant.

Probably this should only be done for stage2. No reason to make stage1 more complicated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    frontendTokenization, parsing, AstGen, Sema, and Liveness.optimization

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions