Skip to content

[clang] await_suspend() -> std::noop_coroutine() = missed optimization #135377

Open
@tzcnt

Description

@tzcnt

When returning std::noop_coroutine() from await_suspend, this always seems to result in:

lea          std::__n4861::coroutine_handle<std::__n4861::noop_coroutine_promise,%rcx
jmp          *(%rcx)

This delegates to a function that is simply ret (<std::__n4861::coroutine_handlestd::__n4861::noop_coroutine_promise::__frame::__dummy_resume_destroy()>)

This seems like a missed optimization. Can we simply inline the ret and skip the indirect jump?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions