arc.c (arc_ifcvt): Use commutativity, e.g.: reg_a := reg_b + reg_a ==> reg_a := reg_a + reg_b

* config/arc/arc.c (arc_ifcvt): Use commutativity, e.g.:
        reg_a := reg_b + reg_a  ==>  reg_a := reg_a + reg_b

From-SVN: r204534
This commit is contained in:
Joern Rennecke 2013-11-07 17:37:11 +00:00 committed by Joern Rennecke
parent 89d3d605c3
commit 9bf218f918
2 changed files with 29 additions and 0 deletions

View file

@ -1,3 +1,8 @@
2013-11-07 Joern Rennecke <joern.rennecke@embecosm.com>
* config/arc/arc.c (arc_ifcvt): Use commutativity, e.g.:
reg_a := reg_b + reg_a ==> reg_a := reg_a + reg_b
2013-11-07 Jeff Law <law@redhat.com>
* doc/invoke.texi (-fisolate-erroneous-paths): Document.

View file

@ -8203,6 +8203,30 @@ arc_ifcvt (void)
{
/* ??? don't conditionalize if all side effects are dead
in the not-execute case. */
/* For commutative operators, we generally prefer to have
the first source match the destination. */
if (GET_CODE (pat) == SET)
{
rtx src = SET_SRC (pat);
if (COMMUTATIVE_P (src))
{
rtx src0 = XEXP (src, 0);
rtx src1 = XEXP (src, 1);
rtx dst = SET_DEST (pat);
if (rtx_equal_p (src1, dst) && !rtx_equal_p (src0, dst)
/* Leave add_n alone - the canonical form is to
have the complex summand first. */
&& REG_P (src0))
pat = gen_rtx_SET (VOIDmode, dst,
gen_rtx_fmt_ee (GET_CODE (src),
GET_MODE (src),
src1, src0));
}
}
/* dwarf2out.c:dwarf2out_frame_debug_expr doesn't know
what to do with COND_EXEC. */
if (RTX_FRAME_RELATED_P (insn))