What is the name of this type of program optimization where two loops operating over common data are combined into a single loop?
It's called &quot;loop fusion&quot;.
It's often more efficient, in the sense of doing more work per loop iteration and sometimes (as you say) other advantages. On the other hand, the fused loop in your example may also put more pressure on the CPU's cache prefetch system. So do test it before declaring it more efficient.