diff options
author | Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org> | 2015-01-17 01:06:43 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <mkuvyrkov@gcc.gnu.org> | 2015-01-17 01:06:43 +0000 |
commit | 340c79045e35c6bceeb60afb30b1001c238c93b6 (patch) | |
tree | b58630fa9c7bde3cf786f46d244c041a2357c3bd /gcc/sched-int.h | |
parent | 71acd4776fee1ef3dfd961dd49967d00f11de7c5 (diff) | |
download | gcc-340c79045e35c6bceeb60afb30b1001c238c93b6.zip gcc-340c79045e35c6bceeb60afb30b1001c238c93b6.tar.gz gcc-340c79045e35c6bceeb60afb30b1001c238c93b6.tar.bz2 |
Model cache auto-prefetcher in scheduler
* config/arm/arm-protos.h (struct tune_params): New field
sched_autopref_queue_depth.
* config/arm/arm.c (sched-int.h): Include header.
(arm_first_cycle_multipass_dfa_lookahead_guard,)
(TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define hook.
(arm_slowmul_tune, arm_fastmul_tune, arm_strongarm_tune,)
(arm_xscale_tune, arm_9e_tune, arm_v6t2_tune, arm_cortex_tune,)
(arm_cortex_a8_tune, arm_cortex_a7_tune, arm_cortex_a15_tune,)
(arm_cortex_a53_tune, arm_cortex_a57_tune, arm_xgene1_tune,)
(arm_cortex_a5_tune, arm_cortex_a9_tune, arm_cortex_a12_tune,)
(arm_v7m_tune, arm_cortex_m7_tune, arm_v6m_tune, arm_fa726te_tune):
Specify sched_autopref_queue_depth value. Enabled for A15 and A57.
* config/arm/t-arm (arm.o): Update.
* haifa-sched.c (update_insn_after_change): Update.
(rank_for_schedule): Use auto-prefetcher model, if requested.
(autopref_multipass_init): New static function.
(autopref_rank_for_schedule): New rank_for_schedule heuristic.
(autopref_multipass_dfa_lookahead_guard_started_dump_p): New static
variable for debug dumps.
(autopref_multipass_dfa_lookahead_guard_1): New static helper function.
(autopref_multipass_dfa_lookahead_guard): New global function that
implements TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD hook.
(init_h_i_d): Update.
* params.def (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH): New tuning knob.
* sched-int.h (enum autopref_multipass_data_status): New const enum.
(autopref_multipass_data_): Structure for auto-prefetcher data.
(autopref_multipass_data_def, autopref_multipass_data_t): New typedefs.
(struct _haifa_insn_data:autopref_multipass_data): New field.
(INSN_AUTOPREF_MULTIPASS_DATA): New access macro.
(autopref_multipass_dfa_lookahead_guard): Declare.
From-SVN: r219789
Diffstat (limited to 'gcc/sched-int.h')
-rw-r--r-- | gcc/sched-int.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 9392d04..28e95ea 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -793,6 +793,32 @@ struct reg_set_data struct reg_set_data *next_insn_set; }; +enum autopref_multipass_data_status { + /* Entry is irrelevant for auto-prefetcher. */ + AUTOPREF_MULTIPASS_DATA_IRRELEVANT = -2, + /* Entry is uninitialized. */ + AUTOPREF_MULTIPASS_DATA_UNINITIALIZED = -1, + /* Entry is relevant for auto-prefetcher and insn can be delayed + to allow another insn through. */ + AUTOPREF_MULTIPASS_DATA_NORMAL = 0, + /* Entry is relevant for auto-prefetcher, but insn should not be + delayed as that will break scheduling. */ + AUTOPREF_MULTIPASS_DATA_DONT_DELAY = 1 +}; + +/* Data for modeling cache auto-prefetcher. */ +struct autopref_multipass_data_ +{ + /* Base part of memory address. */ + rtx base; + /* Memory offset. */ + int offset; + /* Entry status. */ + enum autopref_multipass_data_status status; +}; +typedef struct autopref_multipass_data_ autopref_multipass_data_def; +typedef autopref_multipass_data_def *autopref_multipass_data_t; + struct _haifa_insn_data { /* We can't place 'struct _deps_list' into h_i_d instead of deps_list_t @@ -893,6 +919,10 @@ struct _haifa_insn_data /* The deciding reason for INSN's place in the ready list. */ int last_rfs_win; + + /* Two entries for cache auto-prefetcher model: one for mem reads, + and one for mem writes. */ + autopref_multipass_data_def autopref_multipass_data[2]; }; typedef struct _haifa_insn_data haifa_insn_data_def; @@ -915,6 +945,8 @@ extern vec<haifa_insn_data_def> h_i_d; (HID (INSN)->reg_pressure_excess_cost_change) #define INSN_PRIORITY_STATUS(INSN) (HID (INSN)->priority_status) #define INSN_MODEL_INDEX(INSN) (HID (INSN)->model_index) +#define INSN_AUTOPREF_MULTIPASS_DATA(INSN) \ + (HID (INSN)->autopref_multipass_data) typedef struct _haifa_deps_insn_data haifa_deps_insn_data_def; typedef haifa_deps_insn_data_def *haifa_deps_insn_data_t; @@ -1363,6 +1395,8 @@ extern int cycle_issued_insns; extern int issue_rate; extern int dfa_lookahead; +extern int autopref_multipass_dfa_lookahead_guard (rtx_insn *, int); + extern void ready_sort (struct ready_list *); extern rtx_insn *ready_element (struct ready_list *, int); extern rtx_insn **ready_lastpos (struct ready_list *); |