Hacker News new | ask | show | jobs
by brockrockman 4855 days ago
while this is taking a mathematical/theoretical approach, it's worth reiterating that a modern compiler won't even bother allocating temporary variables on the stack and the values will just move between registers.

Moreover, most modern CPU architectures will just fake the architectural register moves and just use register renaming techniques to avoid the issue completely.

TL;DR: any trick like this will just make your code slower and just use more architectural registers since neither the compiler nor the hardware will be able to reason about your intentions