After the discussion in D79454 it seemed clear we need to clarify the
byval attribute semantics. This is an attempt to make it consistent
with the de-facto behavior and expectations of different LLVM passes.
The clarified rules are phrased such that:
- an empty function with a byval argument is correctly classified as readnone (which it is today: https://godbolt.org/z/nePXM6).
- a call of a readnone function with a byval argument is not classified as readnone (which it is today: https://godbolt.org/z/dDfQ5r)
- we can eliminate the Clang rules that prevent the effect of pure or const on functions that take a byval argument (as they are circumvented by the middle-end anyway)
I doubt this will break existing backends or other parts but actually
avoid us creating (temporary) broken IR during the middle-end
optimizations.
Missing period? "scalars The copy"