From 751d3ba7628c0ba64205673988ee5f7a93b1d4c5 Mon Sep 17 00:00:00 2001 From: carrot Date: Tue, 27 Oct 2009 09:06:36 +0000 Subject: * target.h (have_conditional_execution): Add a new target hook function. * target-def.h (TARGET_HAVE_CONDITIONAL_EXECUTION): Likewise. * targhooks.h (default_have_conditional_execution): Likewise. * targhooks.c (default_have_conditional_execution): Likewise. * doc/tm.texi (TARGET_HAVE_CONDITIONAL_EXECUTION): Document it. * config/arm/arm.c (TARGET_HAVE_CONDITIONAL_EXECUTION): Define it. (arm_have_conditional_execution): New function. * ifcvt.c (noce_process_if_block, find_if_header, cond_exec_find_if_block, dead_or_predicable): Change the usage of macro HAVE_conditional_execution to a target hook call. * recog.c (peephole2_optimize): Likewise. * sched-rgn.c (add_branch_dependences): Likewise. * final.c (asm_insn_count, final_scan_insn): Likewise. * bb-reorder.c (HAVE_conditional_execution): Remove it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153584 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/recog.c | 64 ++++++++++++++++++++++++++++++++----------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) (limited to 'gcc/recog.c') diff --git a/gcc/recog.c b/gcc/recog.c index b03324146f1..4ad3be9dfaf 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3279,40 +3279,44 @@ peephole2_optimize (void) do_cleanup_cfg |= purge_dead_edges (bb); } -#ifdef HAVE_conditional_execution - for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i) - peep2_insn_data[i].insn = NULL_RTX; - peep2_insn_data[peep2_current].insn = PEEP2_EOB; - peep2_current_count = 0; -#else - /* Back up lifetime information past the end of the - newly created sequence. */ - if (++i >= MAX_INSNS_PER_PEEP2 + 1) - i = 0; - bitmap_copy (live, peep2_insn_data[i].live_before); - - /* Update life information for the new sequence. */ - x = attempt; - do + if (targetm.have_conditional_execution ()) { - if (INSN_P (x)) + for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i) + peep2_insn_data[i].insn = NULL_RTX; + peep2_insn_data[peep2_current].insn = PEEP2_EOB; + peep2_current_count = 0; + } + else + { + /* Back up lifetime information past the end of the + newly created sequence. */ + if (++i >= MAX_INSNS_PER_PEEP2 + 1) + i = 0; + bitmap_copy (live, peep2_insn_data[i].live_before); + + /* Update life information for the new sequence. */ + x = attempt; + do { - if (--i < 0) - i = MAX_INSNS_PER_PEEP2; - if (peep2_current_count < MAX_INSNS_PER_PEEP2 - && peep2_insn_data[i].insn == NULL_RTX) - peep2_current_count++; - peep2_insn_data[i].insn = x; - df_insn_rescan (x); - df_simulate_one_insn_backwards (bb, x, live); - bitmap_copy (peep2_insn_data[i].live_before, live); + if (INSN_P (x)) + { + if (--i < 0) + i = MAX_INSNS_PER_PEEP2; + if (peep2_current_count < MAX_INSNS_PER_PEEP2 + && peep2_insn_data[i].insn == NULL_RTX) + peep2_current_count++; + peep2_insn_data[i].insn = x; + df_insn_rescan (x); + df_simulate_one_insn_backwards (bb, x, live); + bitmap_copy (peep2_insn_data[i].live_before, + live); + } + x = PREV_INSN (x); } - x = PREV_INSN (x); - } - while (x != prev); + while (x != prev); - peep2_current = i; -#endif + peep2_current = i; + } /* If we generated a jump instruction, it won't have JUMP_LABEL set. Recompute after we're done. */ -- cgit v1.2.1