Skip to content

Optimize away is_nonconst_rvalue bit for copied in parameters #12

Description

@hsutter

When an in parameter is copied (type is small and trivially copyable), there's no need to pass an extra bit to remember whether it was a non-const rvalue.

Repro 1, extra instruction at the call site for an in int parameter: https://cppx.godbolt.org/z/fz78YW

Repro 2, two extra instructions in the callee for an in int parameter: https://cppx.godbolt.org/z/c8rYdY

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions