I do understand that in general there is significant difference in passing by value and reference, especially for non trivial types, and that it is mainly whether the object is copied or not, with some caveats when we have an rvalue.
However, I'm wondering whether the compiler actually recognizes that these two things are to some extend identical when the passed argument is constant, and automatically optimizes the pass by value to pass by reference? If not I assume that it is standard to make arguments passed by reference almost always, right?