diff options
author | Zhenqiang Chen <zhenqiang.chen@linaro.org> | 2014-05-15 06:54:48 +0000 |
---|---|---|
committer | Zhenqiang Chen <zqchen@gcc.gnu.org> | 2014-05-15 06:54:48 +0000 |
commit | a2e6c10cbd7ff6f51052d5a550b4bf999189aa31 (patch) | |
tree | 7b099524607ef851d55ab807f10d94713196c9d1 /gcc/regcprop.c | |
parent | e974b93b6cb75eb6828918fb4bb8454ed8249096 (diff) | |
download | gcc-a2e6c10cbd7ff6f51052d5a550b4bf999189aa31.zip gcc-a2e6c10cbd7ff6f51052d5a550b4bf999189aa31.tar.gz gcc-a2e6c10cbd7ff6f51052d5a550b4bf999189aa31.tar.bz2 |
regcprop.h: New file.
2014-05-15 Zhenqiang Chen <zhenqiang.chen@linaro.org>
* regcprop.h: New file.
* regcprop.c (skip_debug_insn_p): New decl.
(replace_oldest_value_reg): Check skip_debug_insn_p.
(copyprop_hardreg_forward_bb_without_debug_insn.): New function.
* shrink-wrap.c: include regcprop.h
(prepare_shrink_wrap):
Call copyprop_hardreg_forward_bb_without_debug_insn.
testsuite/ChangeLog:
2014-05-15 Zhenqiang Chen <zhenqiang.chen@linaro.org>
* shrink-wrap-loop.c: New test case.
From-SVN: r210458
Diffstat (limited to 'gcc/regcprop.c')
-rw-r--r-- | gcc/regcprop.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/gcc/regcprop.c b/gcc/regcprop.c index a710cc38..7a5a4f6 100644 --- a/gcc/regcprop.c +++ b/gcc/regcprop.c @@ -77,6 +77,7 @@ struct value_data }; static alloc_pool debug_insn_changes_pool; +static bool skip_debug_insn_p; static void kill_value_one_regno (unsigned, struct value_data *); static void kill_value_regno (unsigned, unsigned, struct value_data *); @@ -485,7 +486,7 @@ replace_oldest_value_reg (rtx *loc, enum reg_class cl, rtx insn, struct value_data *vd) { rtx new_rtx = find_oldest_value_reg (cl, *loc, vd); - if (new_rtx) + if (new_rtx && (!DEBUG_INSN_P (insn) || !skip_debug_insn_p)) { if (DEBUG_INSN_P (insn)) { @@ -1112,6 +1113,26 @@ debug_value_data (struct value_data *vd) vd->e[i].next_regno); } +/* Do copyprop_hardreg_forward_1 for a single basic block BB. + DEBUG_INSN is skipped since we do not want to involve DF related + staff as how it is handled in function pass_cprop_hardreg::execute. + + NOTE: Currently it is only used for shrink-wrap. Maybe extend it + to handle DEBUG_INSN for other uses. */ + +void +copyprop_hardreg_forward_bb_without_debug_insn (basic_block bb) +{ + struct value_data *vd; + vd = XNEWVEC (struct value_data, 1); + init_value_data (vd); + + skip_debug_insn_p = true; + copyprop_hardreg_forward_1 (bb, vd); + free (vd); + skip_debug_insn_p = false; +} + #ifdef ENABLE_CHECKING static void validate_value_data (struct value_data *vd) |