From 59483f68e3dc09f4ce9ac070be4b7c57fc1e5e18 Mon Sep 17 00:00:00 2001 From: zqchen Date: Thu, 15 May 2014 06:54:48 +0000 Subject: 2014-05-15 Zhenqiang Chen * 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 * shrink-wrap-loop.c: New test case. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210458 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/shrink-wrap.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc/shrink-wrap.c') diff --git a/gcc/shrink-wrap.c b/gcc/shrink-wrap.c index 6f0cd0c99d2..f09cfe7b1f9 100644 --- a/gcc/shrink-wrap.c +++ b/gcc/shrink-wrap.c @@ -52,7 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "params.h" #include "bb-reorder.h" #include "shrink-wrap.h" - +#include "regcprop.h" #ifdef HAVE_simple_return @@ -320,6 +320,15 @@ prepare_shrink_wrap (basic_block entry_block) df_ref *ref; bool split_p = false; + if (JUMP_P (BB_END (entry_block))) + { + /* To have more shrink-wrapping opportunities, prepare_shrink_wrap tries + to sink the copies from parameter to callee saved register out of + entry block. copyprop_hardreg_forward_bb_without_debug_insn is called + to release some dependences. */ + copyprop_hardreg_forward_bb_without_debug_insn (entry_block); + } + CLEAR_HARD_REG_SET (uses); CLEAR_HARD_REG_SET (defs); FOR_BB_INSNS_REVERSE_SAFE (entry_block, insn, curr) -- cgit v1.2.1