------- Comment #14 from ubizjak at gmail dot com  2010-06-10 15:12 -------
(In reply to comment #11)

> ADD is always faster than LEA for adding a register. However
> there is a special case on Atom where ADD should be avoided.
> It is true that LEA doesn't touch flags and we used it instead
> of ADD which touches flags. It is an optimization specific for
> Atom. You can think it as a special ADD for Atom and pretend
> it clobbers flags. We shouldn't model it as a real LEA since
> it is used to implement a faster ADD in this special case.

LEA can also implement true three-operand add (rX = rY + rZ), so it can save a
move. Expansion of three operands is effectively disabled due to usage of
ix86_binary_operand_ok in PLUS patterns, so split to LEA certainly has some
benefit.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44470

Reply via email to