diff options
author | Razya Ladelsky <razya@gcc.gnu.org> | 2006-05-04 09:19:02 +0000 |
---|---|---|
committer | Razya Ladelsky <razya@gcc.gnu.org> | 2006-05-04 09:19:02 +0000 |
commit | 8cd37d0b6c5eb9e1ac56518f8d7f1257328e96a0 (patch) | |
tree | ef41d3b028cb0bd843e780b6ff16b1f90786cd60 /gcc/recog.c | |
parent | 23ba9627f42b41b4431d63d55431d01fd5af9bf4 (diff) | |
download | gcc-8cd37d0b6c5eb9e1ac56518f8d7f1257328e96a0.zip gcc-8cd37d0b6c5eb9e1ac56518f8d7f1257328e96a0.tar.gz gcc-8cd37d0b6c5eb9e1ac56518f8d7f1257328e96a0.tar.bz2 |
[multiple changes]
2006-05-04 Leehod Baruch <leehod@il.ibm.com>
* see.c: New file.
* Makefile.in (OBJS-common): Add see.o.
(see.o): Add dependencies.
* common.opt (fsee): New flag for the see optimization was added.
* opts.c (flag_see): Initialized.
* passes.c (init_optimization_passes, pass_see): New pass.
* rtl.h (see_main): Declaration as extern.
* timevar.def (TV_SEE): New.
* tree-pass.h (pass_see): Declaration as extern.
* invoke.texi (-fsee): Document.
* recog.c (validate_simplify_insn): New function.
* recog.h (validate_simplify_insn): Declaration as extern.
* df-problems.c (df_chain_dump): Check for NULL.
2006-05-04 Kenneth Zadeck <zadeck@naturalbridge.com>
Daniel Berlin <dberlin@dberlin.org>
* cfgrtl.c (insert_insn_bb_end_new): New function.
* basic-block.h (insert_insn_bb_end_new): Declaration as extern.
2006-05-04 Leehod Baruch <leehod.baruch@weizmann.ac.il>
* df.h (struct web_entry): Moved from web.c.
(union_defs): Declaration as extern.
(unionfind_root): Likewise.
(unionfind_union): Likewise.
* web.c (struct web_entry): Moved to df.h.
(unionfind_root): Remove static declaration.
(unionfind_union): Likewise.
(union_defs): Likewise and generalize to use callback function.
(web_main): Update arguments for union_defs function call.
From-SVN: r113518
Diffstat (limited to 'gcc/recog.c')
-rw-r--r-- | gcc/recog.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 342699f..cd1cb7d 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -698,6 +698,46 @@ validate_replace_src_group (rtx from, rtx to, rtx insn) d.insn = insn; note_uses (&PATTERN (insn), validate_replace_src_1, &d); } + +/* Try simplify INSN. + Invoke simplify_rtx () on every SET_SRC and SET_DEST inside the INSN's + pattern and return true if something was simplified. */ + +bool +validate_simplify_insn (rtx insn) +{ + int i; + rtx pat = NULL; + rtx newpat = NULL; + + pat = PATTERN (insn); + + if (GET_CODE (pat) == SET) + { + newpat = simplify_rtx (SET_SRC (pat)); + if (newpat && !rtx_equal_p (SET_SRC (pat), newpat)) + validate_change (insn, &SET_SRC (pat), newpat, 1); + newpat = simplify_rtx (SET_DEST (pat)); + if (newpat && !rtx_equal_p (SET_DEST (pat), newpat)) + validate_change (insn, &SET_DEST (pat), newpat, 1); + } + else if (GET_CODE (pat) == PARALLEL) + for (i = 0; i < XVECLEN (pat, 0); i++) + { + rtx s = XVECEXP (pat, 0, i); + + if (GET_CODE (XVECEXP (pat, 0, i)) == SET) + { + newpat = simplify_rtx (SET_SRC (s)); + if (newpat && !rtx_equal_p (SET_SRC (s), newpat)) + validate_change (insn, &SET_SRC (s), newpat, 1); + newpat = simplify_rtx (SET_DEST (s)); + if (newpat && !rtx_equal_p (SET_DEST (s), newpat)) + validate_change (insn, &SET_DEST (s), newpat, 1); + } + } + return ((num_changes_pending () > 0) && (apply_change_group () > 0)); +} #ifdef HAVE_cc0 /* Return 1 if the insn using CC0 set by INSN does not contain |