aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorDoug Evans <devans@cygnus.com>1998-05-20 00:24:32 +0000
committerJeff Law <law@gcc.gnu.org>1998-05-19 18:24:32 -0600
commit7506f49132276e0bd064a169dca106b6436bde7c (patch)
tree934ca7a916b884debf2659218bd495fc6afaa368 /gcc/recog.c
parentd392d163c58a6f9dcc2e68ae20ffde4c1bd69be5 (diff)
downloadgcc-7506f49132276e0bd064a169dca106b6436bde7c.zip
gcc-7506f49132276e0bd064a169dca106b6436bde7c.tar.gz
gcc-7506f49132276e0bd064a169dca106b6436bde7c.tar.bz2
* Global CSE and constant/copy propagation.
* Makefile.in (OBJS): Add gcse.o (STAGESTUFF): Add *.gcse. (gcse.o): Add dependencies. (mostlyclean): Remove *.gcse and */*.gcse. * gcse.c: New file. * loop.c (loop_optimize): Move call to init_alias_analysis. * recog.c (validate_replace_src): New function. * toplev.c (gcse_dump): New global variable. (flag_gcse, gcse_time): Likewise. (compile_file): Initialize gcse_time and clean out the gcse dump file if necessary. (rest_of_compilation): Call gcse_main as requested. Dump RTL after gcse if requested. (main): Enable gcse for -O2 and above. Handle -dG. Enable gcse dumps for -da. * gcc.texi: Add gcse related internal documentation. * invoke.texi: Note new command line options for gcse. * tm.texi: Document AVOID_CCMODE_COPIES. * mips.h (AVOID_CCMODE_COPIES): Define. Co-Authored-By: Jeffrey A Law <law@cygnus.com> From-SVN: r19901
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 8b7d5ac..ded35f7 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -537,6 +537,25 @@ validate_replace_rtx (from, to, insn)
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
return apply_change_group ();
}
+
+/* Try replacing every occurrence of FROM in INSN with TO, avoiding
+ SET_DESTs. After all changes have been made, validate by seeing if
+ INSN is still valid. */
+
+int
+validate_replace_src (from, to, insn)
+ rtx from, to, insn;
+{
+ if ((GET_CODE (insn) != INSN && GET_CODE (insn) != JUMP_INSN)
+ || GET_CODE (PATTERN (insn)) != SET)
+ abort ();
+
+ validate_replace_rtx_1 (&SET_SRC (PATTERN (insn)), from, to, insn);
+ if (GET_CODE (SET_DEST (PATTERN (insn))) == MEM)
+ validate_replace_rtx_1 (&XEXP (SET_DEST (PATTERN (insn)), 0),
+ from, to, insn);
+ return apply_change_group ();
+}
#ifdef HAVE_cc0
/* Return 1 if the insn using CC0 set by INSN does not contain