diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2012-10-16 16:11:00 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2012-10-16 17:11:00 +0100 |
commit | 2407343c3da5e8dc3aee56ab3b7ba168de432973 (patch) | |
tree | 151f058d31629859a64d2c1171d2f55fdcb003d3 /gcc/cfgrtl.c | |
parent | d919140b83feaa44cf32f4e3e9c31ac78278ac27 (diff) | |
download | gcc-2407343c3da5e8dc3aee56ab3b7ba168de432973.zip gcc-2407343c3da5e8dc3aee56ab3b7ba168de432973.tar.gz gcc-2407343c3da5e8dc3aee56ab3b7ba168de432973.tar.bz2 |
loop-doloop.c (doloop_modify): Pass doloop_end pattern to gen_doloop_begin.
* loop-doloop.c (doloop_modify): Pass doloop_end pattern to
gen_doloop_begin.
(doloop_optimize): Pass flag to indicate if loop is entered at top
to gen_doloop_end.
* config/arm/thumb2.md (doloop_end): Accept extra operand.
* config/bfin/bfin.md (doloop_end): Likewise.
* config/c6x/c6x.md (doloop_end): Likewise.
* config/ia64/ia64.md (doloop_end): Likewise.
* config/mep/mep.md (doloop_begin, doloop_end): Likewise.
* config/rs6000/rs6000.md (doloop_end): Likewise.
* config/s390/s390.md (doloop_end): Likewise.
* config/sh/sh.md (doloop_end): Likewise.
* config/spu/spu.md (doloop_end): Likewise.
* config/tilegx/tilegx.md (doloop_end): Likewise.
* config/tilepro/tilepro.md (doloop_end): Likewise.
* doc/md.texi (doloop_end): Document new operand.
* basic-block.h (contains_no_active_insn_p): Declare.
* cfgrtl.c (contains_no_active_insn_p): New function, factored
out of ...
(forwarder_block_p): ... here.
From-SVN: r192505
Diffstat (limited to 'gcc/cfgrtl.c')
-rw-r--r-- | gcc/cfgrtl.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c index 1b578d7..b58562f 100644 --- a/gcc/cfgrtl.c +++ b/gcc/cfgrtl.c @@ -541,10 +541,9 @@ flow_active_insn_p (const_rtx insn) /* Return true if the block has no effect and only forwards control flow to its single destination. */ -/* FIXME: Make this a cfg hook. */ bool -forwarder_block_p (const_basic_block bb) +contains_no_active_insn_p (const_basic_block bb) { rtx insn; @@ -552,6 +551,24 @@ forwarder_block_p (const_basic_block bb) || !single_succ_p (bb)) return false; + for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) + if (INSN_P (insn) && flow_active_insn_p (insn)) + return false; + + return (!INSN_P (insn) + || (JUMP_P (insn) && simplejump_p (insn)) + || !flow_active_insn_p (insn)); +} + +/* Likewise, but protect loop latches, headers and preheaders. */ +/* FIXME: Make this a cfg hook. */ + +bool +forwarder_block_p (const_basic_block bb) +{ + if (!contains_no_active_insn_p (bb)) + return false; + /* Protect loop latches, headers and preheaders. */ if (current_loops) { @@ -563,13 +580,7 @@ forwarder_block_p (const_basic_block bb) return false; } - for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn)) - if (INSN_P (insn) && flow_active_insn_p (insn)) - return false; - - return (!INSN_P (insn) - || (JUMP_P (insn) && simplejump_p (insn)) - || !flow_active_insn_p (insn)); + return true; } /* Return nonzero if we can reach target from src by falling through. */ |