Skip to content

Optimize away is_nonconst_rvalue bit for copied in parameters #12

@hsutter

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions