+2015-10-27 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/aarch64/aarch64-protos.h
+ (struct tune_params): Add autoprefetcher_model field.
+ * config/aarch64/aarch64.c: Include params.h
+ (generic_tunings): Specify autoprefetcher_model value.
+ (cortexa53_tunings): Likewise.
+ (cortexa57_tunings): Likewise.
+ (cortexa72_tunings): Likewise.
+ (thunderx_tunings): Likewise.
+ (xgene1_tunings): Likewise.
+ (aarch64_first_cycle_multipass_dfa_lookahead_guard): New function.
+ (TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD): Define.
+ (aarch64_override_options_internal): Set
+ PARAM_SCHED_AUTOPREF_QUEUE_DEPTH param.
+
2015-10-27 Richard Sandiford <richard.sandiford@arm.com>
* builtins.c (fold_builtin_exponent): Delete.
int vec_reassoc_width;
int min_div_recip_mul_sf;
int min_div_recip_mul_df;
+
+/* An enum specifying how to take into account CPU autoprefetch capabilities
+ during instruction scheduling:
+ - AUTOPREFETCHER_OFF: Do not take autoprefetch capabilities into account.
+ - AUTOPREFETCHER_WEAK: Attempt to sort sequences of loads/store in order of
+ offsets but allow the pipeline hazard recognizer to alter that order to
+ maximize multi-issue opportunities.
+ - AUTOPREFETCHER_STRONG: Attempt to sort sequences of loads/store in order of
+ offsets and prefer this even if it restricts multi-issue opportunities. */
+
+ enum aarch64_autoprefetch_model
+ {
+ AUTOPREFETCHER_OFF,
+ AUTOPREFETCHER_WEAK,
+ AUTOPREFETCHER_STRONG
+ } autoprefetcher_model;
+
unsigned int extra_tuning_flags;
};
#include "reload.h"
#include "langhooks.h"
#include "opts.h"
+#include "params.h"
#include "gimplify.h"
#include "dwarf2.h"
#include "tree-vectorizer.h"
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
};
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
};
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_WEAK, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_RENAME_FMA_REGS) /* tune_flags. */
};
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
};
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
};
1, /* vec_reassoc_width. */
2, /* min_div_recip_mul_sf. */
2, /* min_div_recip_mul_df. */
+ tune_params::AUTOPREFETCHER_OFF, /* autoprefetcher_model. */
(AARCH64_EXTRA_TUNE_NONE) /* tune_flags. */
};
return issue_rate > 1 && !sched_fusion ? issue_rate : 0;
}
+
+/* Implement TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD as
+ autopref_multipass_dfa_lookahead_guard from haifa-sched.c. It only
+ has an effect if PARAM_SCHED_AUTOPREF_QUEUE_DEPTH > 0. */
+
+static int
+aarch64_first_cycle_multipass_dfa_lookahead_guard (rtx_insn *insn,
+ int ready_index)
+{
+ return autopref_multipass_dfa_lookahead_guard (insn, ready_index);
+}
+
+
/* Vectorizer cost model target hooks. */
/* Implement targetm.vectorize.builtin_vectorization_cost. */
initialize_aarch64_code_model (opts);
initialize_aarch64_tls_size (opts);
+ int queue_depth = 0;
+ switch (aarch64_tune_params.autoprefetcher_model)
+ {
+ case tune_params::AUTOPREFETCHER_OFF:
+ queue_depth = -1;
+ break;
+ case tune_params::AUTOPREFETCHER_WEAK:
+ queue_depth = 0;
+ break;
+ case tune_params::AUTOPREFETCHER_STRONG:
+ queue_depth = max_insn_queue_index + 1;
+ break;
+ default:
+ gcc_unreachable ();
+ }
+
+ /* We don't mind passing in global_options_set here as we don't use
+ the *options_set structs anyway. */
+ maybe_set_param_value (PARAM_SCHED_AUTOPREF_QUEUE_DEPTH,
+ queue_depth,
+ opts->x_param_values,
+ global_options_set.x_param_values);
+
aarch64_override_options_after_change_1 (opts);
}
#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
aarch64_sched_first_cycle_multipass_dfa_lookahead
+#undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD
+#define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD_GUARD \
+ aarch64_first_cycle_multipass_dfa_lookahead_guard
+
#undef TARGET_TRAMPOLINE_INIT
#define TARGET_TRAMPOLINE_INIT aarch64_trampoline_init