diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:26:42 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-06 15:26:42 +0000 |
commit | 04fa393515487bde6dc2a0bc318398d983825365 (patch) | |
tree | b0c2fbe3bb30a4c2bdfe6c42b5a41adf0f13bdd7 /gcc/haifa-sched.c | |
parent | b74be4501645c0e07e4e468058ebfc4b711196c2 (diff) | |
download | gcc-04fa393515487bde6dc2a0bc318398d983825365.tar.gz |
2008-08-06 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r138800
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@138805 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/haifa-sched.c')
-rw-r--r-- | gcc/haifa-sched.c | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index d614986b49c..76282bd0ced 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -544,8 +544,6 @@ static void change_queue_index (rtx, int); static void extend_h_i_d (void); static void extend_ready (int); -static void extend_global (rtx); -static void extend_all (rtx); static void init_h_i_d (rtx); static void generate_recovery_code (rtx); static void process_insn_forw_deps_be_in_spec (rtx, rtx, ds_t); @@ -3188,36 +3186,45 @@ extend_ready (int n_new_insns) choice_stack[i].state = xmalloc (dfa_state_size); } -/* Extend global scheduler structures (those, that live across calls to - schedule_block) to include information about just emitted INSN. */ +/* Extend global-scope scheduler data structures + (those, that live within one call to schedule_insns) + to include information about just emitted INSN. */ static void -extend_global (rtx insn) +extend_global_data (rtx insn) { gcc_assert (INSN_P (insn)); - /* These structures have scheduler scope. */ - /* Init h_i_d. */ extend_h_i_d (); init_h_i_d (insn); - /* Init data handled in sched-deps.c. */ - sd_init_insn (insn); - /* Extend dependency caches by one element. */ extend_dependency_caches (1, false); } -/* Extends global and local scheduler structures to include information - about just emitted INSN. */ +/* Extend global- and region-scope scheduler data structures + (those, that live within one call to schedule_region) + to include information about just emitted INSN. */ +static void +extend_region_data (rtx insn) +{ + extend_global_data (insn); + + /* Init dependency data. */ + sd_init_insn (insn); +} + +/* Extend global-, region- and block-scope scheduler data structures + (those, that live within one call to schedule_block) + to include information about just emitted INSN. */ static void -extend_all (rtx insn) -{ - extend_global (insn); +extend_block_data (rtx insn) +{ + extend_region_data (insn); /* These structures have block scope. */ extend_ready (1); - + (*current_sched_info->add_remove_insn) (insn, 0); } @@ -3391,7 +3398,7 @@ add_to_speculative_block (rtx insn) rec = BLOCK_FOR_INSN (check); twin = emit_insn_before (copy_insn (PATTERN (insn)), BB_END (rec)); - extend_global (twin); + extend_region_data (twin); sd_copy_back_deps (twin, insn, true); @@ -3581,7 +3588,7 @@ init_before_recovery (void) x = emit_jump_insn_after (gen_jump (label), BB_END (single)); JUMP_LABEL (x) = label; LABEL_NUSES (label)++; - extend_global (x); + extend_global_data (x); emit_barrier_after (x); @@ -3681,7 +3688,7 @@ create_check_block_twin (rtx insn, bool mutate_p) check = emit_insn_before (check, insn); /* Extend data structures. */ - extend_all (check); + extend_block_data (check); RECOVERY_BLOCK (check) = rec; if (sched_verbose && spec_info->dump) @@ -3708,7 +3715,7 @@ create_check_block_twin (rtx insn, bool mutate_p) } twin = emit_insn_after (ORIG_PAT (insn), BB_END (rec)); - extend_global (twin); + extend_region_data (twin); if (sched_verbose && spec_info->dump) /* INSN_BB (insn) isn't determined for twin insns yet. @@ -3761,7 +3768,7 @@ create_check_block_twin (rtx insn, bool mutate_p) jump = emit_jump_insn_after (gen_jump (label), BB_END (rec)); JUMP_LABEL (jump) = label; LABEL_NUSES (label)++; - extend_global (jump); + extend_region_data (jump); if (BB_PARTITION (second_bb) != BB_PARTITION (rec)) /* Partition type is the same, if it is "unpartitioned". */ @@ -4012,32 +4019,6 @@ change_pattern (rtx insn, rtx new_pat) dfa_clear_single_insn_cache (insn); } -/* Return true if INSN can potentially be speculated with type DS. */ -bool -sched_insn_is_legitimate_for_speculation_p (const_rtx insn, ds_t ds) -{ - if (HAS_INTERNAL_DEP (insn)) - return false; - - if (!NONJUMP_INSN_P (insn)) - return false; - - if (SCHED_GROUP_P (insn)) - return false; - - if (IS_SPECULATION_CHECK_P (insn)) - return false; - - if (side_effects_p (PATTERN (insn))) - return false; - - if ((ds & BE_IN_SPEC) - && may_trap_p (PATTERN (insn))) - return false; - - return true; -} - /* -1 - can't speculate, 0 - for speculation with REQUEST mode it is OK to use current instruction pattern, |