Uros Bizjak <ubiz...@gmail.com> writes: > Hello! > > Sometimes, gcc generates: > > leaq (%rbx,%rax), %rax > > that is in fact equivalent (modulo flags reg clobber) to: > > addq %rbx, %rax > > Attached patch adds additional peephole2 patterns that convert LEA to > ADD when second operand of PLUS RTX matches output operand.
Are you sure this is a win? In the past on some CPUs this was done intentionally because the AGU had more execution resources than the ALU. -Andi -- a...@linux.intel.com -- Speaking for myself only