diff options
author | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-28 20:02:59 +0000 |
---|---|---|
committer | vmakarov <vmakarov@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-28 20:02:59 +0000 |
commit | ae72d5b2c7868a590a3744b48c92d85c2e4bc093 (patch) | |
tree | 888f79b5020c2fcd4c6a06b52d30340a3f6cfc2c | |
parent | 091c59758fdda61f8fed4fad6f3b61b08bdbb29c (diff) | |
download | gcc-ae72d5b2c7868a590a3744b48c92d85c2e4bc093.tar.gz |
2012-10-28 Vladimir Makarov <vmakarov@redhat.com>
* rtl.h (struct rtx_def): Add a comment for member unchanging.
* lra-int.h (LRA_TEMP_CLOBBER_P): New macro.
(lra_hard_reg_substitution): Rename to lra_final_code_change.
* lra-constraints.c (match_reload): Mark temporary clobbers.
* lra-spill.c (lra_hard_reg_substitution): Rename to
lra_final_code_change. Remove temporary clobbers.
* lra.c (lra): Rename to lra_final_code_change.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192897 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/lra-constraints.c | 8 | ||||
-rw-r--r-- | gcc/lra-int.h | 6 | ||||
-rw-r--r-- | gcc/lra-spills.c | 20 | ||||
-rw-r--r-- | gcc/lra.c | 2 | ||||
-rw-r--r-- | gcc/rtl.h | 3 |
6 files changed, 39 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e30bc1e7ea..e3119c22a52 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-10-28 Vladimir Makarov <vmakarov@redhat.com> + + * rtl.h (struct rtx_def): Add a comment for member unchanging. + * lra-int.h (LRA_TEMP_CLOBBER_P): New macro. + (lra_hard_reg_substitution): Rename to lra_final_code_change. + * lra-constraints.c (match_reload): Mark temporary clobbers. + * lra-spill.c (lra_hard_reg_substitution): Rename to + lra_final_code_change. Remove temporary clobbers. + * lra.c (lra): Rename to lra_final_code_change. + 2012-10-28 Jan Hubicka <jh@suse.cz> * gcc.dg/ipa/inlinehint-3.c: New testcase. diff --git a/gcc/lra-constraints.c b/gcc/lra-constraints.c index 9e4d3b1f6de..4b3dbc01ec3 100644 --- a/gcc/lra-constraints.c +++ b/gcc/lra-constraints.c @@ -663,7 +663,7 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class, rtx *before, rtx *after) { int i, in; - rtx new_in_reg, new_out_reg, reg; + rtx new_in_reg, new_out_reg, reg, clobber; enum machine_mode inmode, outmode; rtx in_rtx = *curr_id->operand_loc[ins[0]]; rtx out_rtx = *curr_id->operand_loc[out]; @@ -694,8 +694,10 @@ match_reload (signed char out, signed char *ins, enum reg_class goal_class, new_in_reg = gen_rtx_SUBREG (inmode, reg, 0); /* NEW_IN_REG is non-paradoxical subreg. We don't want NEW_OUT_REG living above. We add clobber clause for - this. */ - emit_clobber (new_out_reg); + this. This is just a temporary clobber. We can remove + it at the end of LRA work. */ + clobber = emit_clobber (new_out_reg); + LRA_TEMP_CLOBBER_P (PATTERN (clobber)) = 1; } } else diff --git a/gcc/lra-int.h b/gcc/lra-int.h index f88145b7e73..8a9865087d0 100644 --- a/gcc/lra-int.h +++ b/gcc/lra-int.h @@ -241,6 +241,10 @@ struct lra_insn_recog_data typedef struct lra_insn_recog_data *lra_insn_recog_data_t; +/* Whether the clobber is used temporary in LRA. */ +#define LRA_TEMP_CLOBBER_P(x) \ + (RTL_FLAG_CHECK1 ("TEMP_CLOBBER_P", (x), CLOBBER)->unchanging) + /* lra.c: */ extern FILE *lra_dump_file; @@ -346,7 +350,7 @@ extern bool lra_coalesce (void); extern bool lra_need_for_spills_p (void); extern void lra_spill (void); -extern void lra_hard_reg_substitution (void); +extern void lra_final_code_change (void); /* lra-elimination.c: */ diff --git a/gcc/lra-spills.c b/gcc/lra-spills.c index 8ff91d81139..af21c480f77 100644 --- a/gcc/lra-spills.c +++ b/gcc/lra-spills.c @@ -614,13 +614,13 @@ alter_subregs (rtx *loc, bool final_p) } /* Final change of pseudos got hard registers into the corresponding - hard registers. */ + hard registers and removing temporary clobbers. */ void -lra_hard_reg_substitution (void) +lra_final_code_change (void) { int i, hard_regno; basic_block bb; - rtx insn; + rtx insn, curr; int max_regno = max_reg_num (); for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++) @@ -628,9 +628,21 @@ lra_hard_reg_substitution (void) && (hard_regno = lra_get_regno_hard_regno (i)) >= 0) SET_REGNO (regno_reg_rtx[i], hard_regno); FOR_EACH_BB (bb) - FOR_BB_INSNS (bb, insn) + FOR_BB_INSNS_SAFE (bb, insn, curr) if (INSN_P (insn)) { + rtx pat = PATTERN (insn); + + if (GET_CODE (pat) == CLOBBER && LRA_TEMP_CLOBBER_P (pat)) + { + /* Remove clobbers temporarily created in LRA. We don't + need them anymore and don't want to waste compiler + time processing them in a few subsequent passes. */ + lra_invalidate_insn_data (insn); + remove_insn (insn); + continue; + } + lra_insn_recog_data_t id = lra_get_insn_recog_data (insn); bool insn_change_p = false; diff --git a/gcc/lra.c b/gcc/lra.c index a56da78380b..9c4e5bf5cfe 100644 --- a/gcc/lra.c +++ b/gcc/lra.c @@ -2334,7 +2334,7 @@ lra (FILE *f) } restore_scratches (); lra_eliminate (true); - lra_hard_reg_substitution (); + lra_final_code_change (); lra_in_progress = 0; lra_clear_live_ranges (); lra_live_ranges_finish (); diff --git a/gcc/rtl.h b/gcc/rtl.h index 43a49c44ed7..4ee27d99cfe 100644 --- a/gcc/rtl.h +++ b/gcc/rtl.h @@ -283,7 +283,8 @@ struct GTY((chain_next ("RTX_NEXT (&%h)"), 1 in a NOTE, or EXPR_LIST for a const call. 1 in a JUMP_INSN of an annulling branch. 1 in a CONCAT is VAL_EXPR_IS_CLOBBERED in var-tracking.c. - 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.c. */ + 1 in a preserved VALUE is PRESERVED_VALUE_P in cselib.c. + 1 in a clobber temporarily created for LRA. */ unsigned int unchanging : 1; /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile. 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE |