+2017-06-16 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
+
+ * config/aarch64/aarch64.c (aarch64_override_options_internal):
+ Set flag_prefetch_loop_arrays according to tuning data.
+
2017-06-16 Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
* config/aarch64/aarch64-protos.h (struct cpu_prefetch_tune):
0, /* num_slots */
-1, /* l1_cache_size */
-1, /* l1_cache_line_size */
- -1 /* l2_cache_size */
+ -1, /* l2_cache_size */
+ -1 /* default_opt_level */
};
static const cpu_prefetch_tune exynosm1_prefetch_tune =
0, /* num_slots */
-1, /* l1_cache_size */
64, /* l1_cache_line_size */
- -1 /* l2_cache_size */
+ -1, /* l2_cache_size */
+ -1 /* default_opt_level */
};
static const cpu_prefetch_tune qdf24xx_prefetch_tune =
0, /* num_slots */
-1, /* l1_cache_size */
64, /* l1_cache_line_size */
- -1 /* l2_cache_size */
+ -1, /* l2_cache_size */
+ -1 /* default_opt_level */
};
static const cpu_prefetch_tune thunderx2t99_prefetch_tune =
0, /* num_slots */
-1, /* l1_cache_size */
64, /* l1_cache_line_size */
- -1 /* l2_cache_size */
+ -1, /* l2_cache_size */
+ -1 /* default_opt_level */
};
static const struct tune_params generic_tunings =
opts->x_param_values,
global_options_set.x_param_values);
+ /* Enable sw prefetching at specified optimization level for
+ CPUS that have prefetch. Lower optimization level threshold by 1
+ when profiling is enabled. */
+ if (opts->x_flag_prefetch_loop_arrays < 0
+ && !opts->x_optimize_size
+ && aarch64_tune_params.prefetch->default_opt_level >= 0
+ && opts->x_optimize >= aarch64_tune_params.prefetch->default_opt_level)
+ opts->x_flag_prefetch_loop_arrays = 1;
+
aarch64_override_options_after_change_1 (opts);
}