Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize away is_nonconst_rvalue bit for copied in parameters #12

Open
hsutter opened this issue Nov 28, 2020 · 0 comments
Open

Optimize away is_nonconst_rvalue bit for copied in parameters #12

hsutter opened this issue Nov 28, 2020 · 0 comments
Assignees
Labels
prototype-codegen-quality Code generation quality

Comments

@hsutter
Copy link
Owner

hsutter commented Nov 28, 2020

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

@hsutter hsutter added the prototype-codegen-quality Code generation quality label Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prototype-codegen-quality Code generation quality
Projects
None yet
Development

No branches or pull requests

2 participants