diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:15:03 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@arm.com> | 2020-12-17 00:15:03 +0000 |
commit | 21335c48576d0968126add51adef9a4ce0dddf07 (patch) | |
tree | ce59eab22b31ef573526f7e9df9696120bbef94a /gcc/combine.c | |
parent | d4b520d88ee5b4cd446ef001c8fdddd9af8d681c (diff) | |
download | gcc-21335c48576d0968126add51adef9a4ce0dddf07.zip gcc-21335c48576d0968126add51adef9a4ce0dddf07.tar.gz gcc-21335c48576d0968126add51adef9a4ce0dddf07.tar.bz2 |
Split update_cfg_for_uncondjump out of combine
Later patches want to reuse combine's update_cfg_for_uncondjump,
so this patch makes it a public cfgrtl.c function.
gcc/
* cfgrtl.h (update_cfg_for_uncondjump): Declare.
* combine.c (update_cfg_for_uncondjump): Move to...
* cfgrtl.c: ...here.
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ed1ad45..5864474 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2531,42 +2531,6 @@ reg_subword_p (rtx x, rtx reg) && GET_MODE_CLASS (GET_MODE (x)) == MODE_INT; } -/* Delete the unconditional jump INSN and adjust the CFG correspondingly. - Note that the INSN should be deleted *after* removing dead edges, so - that the kept edge is the fallthrough edge for a (set (pc) (pc)) - but not for a (set (pc) (label_ref FOO)). */ - -static void -update_cfg_for_uncondjump (rtx_insn *insn) -{ - basic_block bb = BLOCK_FOR_INSN (insn); - gcc_assert (BB_END (bb) == insn); - - purge_dead_edges (bb); - - delete_insn (insn); - if (EDGE_COUNT (bb->succs) == 1) - { - rtx_insn *insn; - - single_succ_edge (bb)->flags |= EDGE_FALLTHRU; - - /* Remove barriers from the footer if there are any. */ - for (insn = BB_FOOTER (bb); insn; insn = NEXT_INSN (insn)) - if (BARRIER_P (insn)) - { - if (PREV_INSN (insn)) - SET_NEXT_INSN (PREV_INSN (insn)) = NEXT_INSN (insn); - else - BB_FOOTER (bb) = NEXT_INSN (insn); - if (NEXT_INSN (insn)) - SET_PREV_INSN (NEXT_INSN (insn)) = PREV_INSN (insn); - } - else if (LABEL_P (insn)) - break; - } -} - /* Return whether PAT is a PARALLEL of exactly N register SETs followed by an arbitrary number of CLOBBERs. */ static bool |