Commit d7bfd907 by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

sched-int.h (IS_SPECULATION_CHECK_P, [...]): New macros.

2006-10-06  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	* sched-int.h (IS_SPECULATION_CHECK_P, IS_SPECULATION_SIMPLE_CHECK_P):
	New macros.
	* sched-ebb.c (begin_schedule_ready): Use them.
	* haifa-sched.c (schedule_insn, move_insn, try_ready,
	add_to_speculative_block, create_check_block_twin, speculate_insn,
	fix_jump_move, move_block_after_check): Ditto.
	* sched-rgn.c (new_ready): Ditto.

From-SVN: r117516
parent 7ea84dc4
2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> 2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
* sched-int.h (IS_SPECULATION_CHECK_P, IS_SPECULATION_SIMPLE_CHECK_P):
New macros.
* sched-ebb.c (begin_schedule_ready): Use them.
* haifa-sched.c (schedule_insn, move_insn, try_ready,
add_to_speculative_block, create_check_block_twin, speculate_insn,
fix_jump_move, move_block_after_check): Ditto.
* sched-rgn.c (new_ready): Ditto.
2006-10-06 Maxim Kuvyrkov <mkuvyrkov@ispras.ru>
PR rtl-optimization/29128 PR rtl-optimization/29128
* sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro. * sched-int.h (IS_SPECULATION_BRANCHY_CHECK_P): New macro.
* sched-ebb.c (advance_target_bb): Use it to fix condition to * sched-ebb.c (advance_target_bb): Use it to fix condition to
......
...@@ -1190,8 +1190,7 @@ schedule_insn (rtx insn) ...@@ -1190,8 +1190,7 @@ schedule_insn (rtx insn)
resolve_dep (next, insn); resolve_dep (next, insn);
if (!RECOVERY_BLOCK (insn) if (!IS_SPECULATION_BRANCHY_CHECK_P (insn))
|| RECOVERY_BLOCK (insn) == EXIT_BLOCK_PTR)
{ {
int effective_cost; int effective_cost;
...@@ -1960,8 +1959,7 @@ move_insn (rtx insn) ...@@ -1960,8 +1959,7 @@ move_insn (rtx insn)
gcc_assert (!jump_p gcc_assert (!jump_p
|| ((current_sched_info->flags & SCHED_RGN) || ((current_sched_info->flags & SCHED_RGN)
&& RECOVERY_BLOCK (insn) && IS_SPECULATION_BRANCHY_CHECK_P (insn))
&& RECOVERY_BLOCK (insn) != EXIT_BLOCK_PTR)
|| (current_sched_info->flags & SCHED_EBB)); || (current_sched_info->flags & SCHED_EBB));
gcc_assert (BLOCK_FOR_INSN (PREV_INSN (insn)) == bb); gcc_assert (BLOCK_FOR_INSN (PREV_INSN (insn)) == bb);
...@@ -3115,8 +3113,7 @@ try_ready (rtx next) ...@@ -3115,8 +3113,7 @@ try_ready (rtx next)
or we simply don't care (*ts & HARD_DEP). */ or we simply don't care (*ts & HARD_DEP). */
gcc_assert (!ORIG_PAT (next) gcc_assert (!ORIG_PAT (next)
|| !RECOVERY_BLOCK (next) || !IS_SPECULATION_BRANCHY_CHECK_P (next));
|| RECOVERY_BLOCK (next) == EXIT_BLOCK_PTR);
if (*ts & HARD_DEP) if (*ts & HARD_DEP)
{ {
...@@ -3128,11 +3125,11 @@ try_ready (rtx next) ...@@ -3128,11 +3125,11 @@ try_ready (rtx next)
change_queue_index (next, QUEUE_NOWHERE); change_queue_index (next, QUEUE_NOWHERE);
return -1; return -1;
} }
else if (!(*ts & BEGIN_SPEC) && ORIG_PAT (next) && !RECOVERY_BLOCK (next)) else if (!(*ts & BEGIN_SPEC) && ORIG_PAT (next) && !IS_SPECULATION_CHECK_P (next))
/* We should change pattern of every previously speculative /* We should change pattern of every previously speculative
instruction - and we determine if NEXT was speculative by using instruction - and we determine if NEXT was speculative by using
ORIG_PAT field. Except one case - simple checks have ORIG_PAT ORIG_PAT field. Except one case - speculation checks have ORIG_PAT
pat too, hence we also check for the RECOVERY_BLOCK. */ pat too, so skip them. */
{ {
change_pattern (next, ORIG_PAT (next)); change_pattern (next, ORIG_PAT (next));
ORIG_PAT (next) = 0; ORIG_PAT (next) = 0;
...@@ -3444,7 +3441,7 @@ add_to_speculative_block (rtx insn) ...@@ -3444,7 +3441,7 @@ add_to_speculative_block (rtx insn)
check = XEXP (link, 0); check = XEXP (link, 0);
if (RECOVERY_BLOCK (check)) if (IS_SPECULATION_SIMPLE_CHECK_P (check))
{ {
create_check_block_twin (check, true); create_check_block_twin (check, true);
link = LOG_LINKS (insn); link = LOG_LINKS (insn);
...@@ -3466,7 +3463,8 @@ add_to_speculative_block (rtx insn) ...@@ -3466,7 +3463,8 @@ add_to_speculative_block (rtx insn)
&& (DEP_STATUS (link) & DEP_TYPES) == DEP_TRUE); && (DEP_STATUS (link) & DEP_TYPES) == DEP_TRUE);
check = XEXP (link, 0); check = XEXP (link, 0);
gcc_assert (!RECOVERY_BLOCK (check) && !ORIG_PAT (check)
gcc_assert (!IS_SPECULATION_CHECK_P (check) && !ORIG_PAT (check)
&& QUEUE_INDEX (check) == QUEUE_NOWHERE); && QUEUE_INDEX (check) == QUEUE_NOWHERE);
rec = BLOCK_FOR_INSN (check); rec = BLOCK_FOR_INSN (check);
...@@ -3718,7 +3716,7 @@ create_check_block_twin (rtx insn, bool mutate_p) ...@@ -3718,7 +3716,7 @@ create_check_block_twin (rtx insn, bool mutate_p)
gcc_assert (ORIG_PAT (insn) gcc_assert (ORIG_PAT (insn)
&& (!mutate_p && (!mutate_p
|| (RECOVERY_BLOCK (insn) == EXIT_BLOCK_PTR || (IS_SPECULATION_SIMPLE_CHECK_P (insn)
&& !(TODO_SPEC (insn) & SPECULATIVE)))); && !(TODO_SPEC (insn) & SPECULATIVE))));
/* Create recovery block. */ /* Create recovery block. */
...@@ -4091,7 +4089,7 @@ speculate_insn (rtx insn, ds_t request, rtx *new_pat) ...@@ -4091,7 +4089,7 @@ speculate_insn (rtx insn, ds_t request, rtx *new_pat)
|| (request & spec_info->mask) != request) || (request & spec_info->mask) != request)
return -1; return -1;
gcc_assert (!RECOVERY_BLOCK (insn)); gcc_assert (!IS_SPECULATION_CHECK_P (insn));
if (request & BE_IN_SPEC) if (request & BE_IN_SPEC)
{ {
...@@ -4299,8 +4297,7 @@ fix_jump_move (rtx jump) ...@@ -4299,8 +4297,7 @@ fix_jump_move (rtx jump)
jump_bb_next = jump_bb->next_bb; jump_bb_next = jump_bb->next_bb;
gcc_assert (current_sched_info->flags & SCHED_EBB gcc_assert (current_sched_info->flags & SCHED_EBB
|| (RECOVERY_BLOCK (jump) || IS_SPECULATION_BRANCHY_CHECK_P (jump));
&& RECOVERY_BLOCK (jump) != EXIT_BLOCK_PTR));
if (!NOTE_INSN_BASIC_BLOCK_P (BB_END (jump_bb_next))) if (!NOTE_INSN_BASIC_BLOCK_P (BB_END (jump_bb_next)))
/* if jump_bb_next is not empty. */ /* if jump_bb_next is not empty. */
...@@ -4333,8 +4330,8 @@ move_block_after_check (rtx jump) ...@@ -4333,8 +4330,8 @@ move_block_after_check (rtx jump)
update_bb_for_insn (jump_bb); update_bb_for_insn (jump_bb);
gcc_assert (RECOVERY_BLOCK (jump) gcc_assert (IS_SPECULATION_CHECK_P (jump)
|| RECOVERY_BLOCK (BB_END (jump_bb_next))); || IS_SPECULATION_CHECK_P (BB_END (jump_bb_next)));
unlink_block (jump_bb_next); unlink_block (jump_bb_next);
link_block (jump_bb_next, bb); link_block (jump_bb_next, bb);
......
...@@ -145,7 +145,7 @@ begin_schedule_ready (rtx insn, rtx last) ...@@ -145,7 +145,7 @@ begin_schedule_ready (rtx insn, rtx last)
gcc_assert (!e || !(e->flags & EDGE_COMPLEX)); gcc_assert (!e || !(e->flags & EDGE_COMPLEX));
gcc_assert (BLOCK_FOR_INSN (insn) == last_bb gcc_assert (BLOCK_FOR_INSN (insn) == last_bb
&& !RECOVERY_BLOCK (insn) && !IS_SPECULATION_CHECK_P (insn)
&& BB_HEAD (last_bb) != insn && BB_HEAD (last_bb) != insn
&& BB_END (last_bb) == insn); && BB_END (last_bb) == insn);
......
...@@ -359,6 +359,14 @@ extern regset *glat_start, *glat_end; ...@@ -359,6 +359,14 @@ extern regset *glat_start, *glat_end;
#define RECOVERY_BLOCK(INSN) (h_i_d[INSN_UID (INSN)].recovery_block) #define RECOVERY_BLOCK(INSN) (h_i_d[INSN_UID (INSN)].recovery_block)
#define ORIG_PAT(INSN) (h_i_d[INSN_UID (INSN)].orig_pat) #define ORIG_PAT(INSN) (h_i_d[INSN_UID (INSN)].orig_pat)
/* INSN is either a simple or a branchy speculation check. */
#define IS_SPECULATION_CHECK_P(INSN) (RECOVERY_BLOCK (INSN) != NULL)
/* INSN is a speculation check that will simply reexecute the speculatively
scheduled instruction if the speculation fail. */
#define IS_SPECULATION_SIMPLE_CHECK_P(INSN) \
(RECOVERY_BLOCK (INSN) == EXIT_BLOCK_PTR)
/* INSN is a speculation check that will branch to RECOVERY_BLOCK if the /* INSN is a speculation check that will branch to RECOVERY_BLOCK if the
speculation fail. Insns in that block will reexecute the speculatively speculation fail. Insns in that block will reexecute the speculatively
scheduled code and then will return immediatelly after INSN thus preserving scheduled code and then will return immediatelly after INSN thus preserving
......
...@@ -2089,7 +2089,7 @@ new_ready (rtx next, ds_t ts) ...@@ -2089,7 +2089,7 @@ new_ready (rtx next, ds_t ts)
&& ((recog_memoized (next) >= 0 && ((recog_memoized (next) >= 0
&& min_insn_conflict_delay (curr_state, next, next) && min_insn_conflict_delay (curr_state, next, next)
> PARAM_VALUE (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY)) > PARAM_VALUE (PARAM_MAX_SCHED_INSN_CONFLICT_DELAY))
|| RECOVERY_BLOCK (next) || IS_SPECULATION_CHECK_P (next)
|| !check_live (next, INSN_BB (next)) || !check_live (next, INSN_BB (next))
|| (not_ex_free = !is_exception_free (next, INSN_BB (next), || (not_ex_free = !is_exception_free (next, INSN_BB (next),
target_bb))))) target_bb)))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment