> I've sedded openempires to replace occurrences of _Type name_ with C++'s _Type& name_ for all functions arguments
This isn’t a valid transformation :/
> Compilers love singly assigned const values
I mean, they’re going to convert to SSA for you anyways.
> and seem to suffer under heavy pointer aliasing
Have you tried restrict?
> This leads to structs being passed by value
do compilers generally optimize this away on -O3, or do you just accept the performance hit in exchange for prettier code?
Re:Single-Assignment C
by asymptotically2 on Friday December 27, 2019 @04:19AM
(#21890148)
If it's a static method (or in an anonymous namespace in C++), it should get fixed at any optimisation level. However if it's a global method, you'll need to pass -flto to defer optimisations to link time to make it work.
As for performance I am heavily relying on LTO. I seem to get a 50% performance boost with pass by values on structs - as I've sedded openempires to replace occurrences of _Type name_ with C++'s _Type& name_ for all functions arguments - and the added pointer aliasing and de-references bogged the engine down in heavily forested areas.
Compilers love singly assigned const values, and seem to suffer under heavy pointer aliasing.