4 ms·
Are you sure those are missed optimization opportunities where llvm copied values to registers as temporary storage instead of a direct copy to the destination
by jsd1982 8y ago
Are you sure those are missed optimization opportunities where llvm copied values to registers as temporary storage instead of a direct copy to the destination register? I saw use of the temporary registers below the lines in question. Perhaps it was just a cheap copy of the value to a register which will be used later because the original destination register was clobbered.
Also I would hazard a guess that pushing flag state into a register is a lot faster than the stack.
Finally, it'd be interesting to see the original hand-rolled inline assembly used with "r" instead of "m" to see how llvm stacks up against the intended version without the redundant memory load/stores.
- nonsince 8y agoGreat catch, you're absolutely right. LLVM is smarter than me once again.