On Sunday, 15 August 2021 at 07:10:17 UTC, JG wrote:
Hi, This is exactly the behaviour I was trying to obtain.It however comes with a fair amount of overhead, as can be seen in the following llvm ir:[...]
I'm not really familiar with llvm ir, but looking at it on godbolt, it seems like the main difference is that taking the address of `s.x` forces the compiler to place `s` in memory, rather than keeping it entirely in registers:
https://d.godbolt.org/z/1afbsM6fv