zig
zig copied to clipboard
better code generated for async functions which are never called with `async`
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.