“In a synthetic benchmark, this change has sped up the loop from 320 us to 80 us.”

Add a branch that does nothing and the loop runs four times faster. The trick turns a latency-bound loop into a throughput-bound one by letting the branch predictor speculate past data dependencies. It also requires a volatile cast to stop the compiler from deleting the optimization. Your CPU and your compiler are fighting each other and you are the referee.