708 icon indicating copy to clipboard operation
708 copied to clipboard

Optimize away `is_nonconst_rvalue` bit for copied `in` parameters

Open hsutter opened this issue 5 years ago • 0 comments

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 avatar Nov 28 '20 22:11 hsutter