Commit 16b2cafd by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

Enable -fprefetch-loop-arrays at given optimization level.

	* config/aarch64/aarch64.c (aarch64_override_options_internal):
	Set flag_prefetch_loop_arrays according to tuning data.

Change-Id: Id41411e671e0a55dc7268e0ad0a4e8ff1421c90a

From-SVN: r249241
parent 9d2c6e2e
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):
New tune structure.
(struct tune_params): Use cpu_prefetch_tune instead of cache_line_size.
......
......@@ -210,6 +210,7 @@ struct cpu_prefetch_tune
const int l1_cache_size;
const int l1_cache_line_size;
const int l2_cache_size;
const int default_opt_level;
};
struct tune_params
......
......@@ -532,7 +532,8 @@ static const cpu_prefetch_tune generic_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 =
......@@ -540,7 +541,8 @@ 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 =
......@@ -548,7 +550,8 @@ 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 =
......@@ -556,7 +559,8 @@ 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 =
......@@ -8806,6 +8810,15 @@ aarch64_override_options_internal (struct gcc_options *opts)
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);
}
......
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