zig icon indicating copy to clipboard operation
zig copied to clipboard

better code generated for async functions which are never called with `async`

Open andrewrk opened this issue 6 years ago • 0 comments

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.

andrewrk avatar Aug 15 '19 22:08 andrewrk