This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR rtl-optimization/14851: Move three-linked combine passbefore two-linked
- From: Uros Bizjak <uros at kss-loka dot si>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Roger Sayle <roger at eyesopen dot com>
- Date: Mon, 14 Mar 2005 07:41:17 +0100
- Subject: [PATCH] PR rtl-optimization/14851: Move three-linked combine passbefore two-linked
Hello!
I would like to resend a combiner patch that moves three-linked combine
pass before two-linked pass. A long explanation with a benchmark result
can be found in http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02193.html.
This patch was considered too risky for 4.0 stage3 and thus queued for
4.1 via PR 17652.
Patch, diffed against current mainline is attached to this message.
Patch is bootstrapped on i386-pc-linux-gnu, regtested c,c++.
2005-03-14 Uros Bizjak <uros@kss-loka.si>
PR rtl-optimization/14851
PR target/19150
* combine.c (combine_instructions): Move 'three linked insns'
pass before 'two linked insns' pass.
Uros.
Index: combine.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/combine.c,v
retrieving revision 1.479
diff -u -p -r1.479 combine.c
--- combine.c 10 Mar 2005 21:26:03 -0000 1.479
+++ combine.c 14 Mar 2005 06:29:59 -0000
@@ -750,13 +750,6 @@ combine_instructions (rtx f, unsigned in
insn based upon SUBREG flags. */
check_promoted_subreg (insn, PATTERN (insn));
- /* Try this insn with each insn it links back to. */
-
- for (links = LOG_LINKS (insn); links; links = XEXP (links, 1))
- if ((next = try_combine (insn, XEXP (links, 0),
- NULL_RTX, &new_direct_jump_p)) != 0)
- goto retry;
-
/* Try each sequence of three linked insns ending with this one. */
for (links = LOG_LINKS (insn); links; links = XEXP (links, 1))
@@ -777,6 +770,13 @@ combine_instructions (rtx f, unsigned in
goto retry;
}
+ /* Try this insn with each insn it links back to. */
+
+ for (links = LOG_LINKS (insn); links; links = XEXP (links, 1))
+ if ((next = try_combine (insn, XEXP (links, 0),
+ NULL_RTX, &new_direct_jump_p)) != 0)
+ goto retry;
+
#ifdef HAVE_cc0
/* Try to combine a jump insn that uses CC0
with a preceding insn that sets CC0, and maybe with its