aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-prefetch.c
diff options
context:
space:
mode:
authorZdenek Dvorak <dvorakz@suse.cz>2006-11-12 20:17:02 +0100
committerZdenek Dvorak <rakdver@gcc.gnu.org>2006-11-12 19:17:02 +0000
commit47eb5b329bf8e6ab2e939a4cedf5533d02a6c7f1 (patch)
tree3dfa782960185e45d610e396ad0016d74f247a11 /gcc/tree-ssa-loop-prefetch.c
parent015e23f4005b00afaf87c90ef67db48b364fe70e (diff)
downloadgcc-47eb5b329bf8e6ab2e939a4cedf5533d02a6c7f1.zip
gcc-47eb5b329bf8e6ab2e939a4cedf5533d02a6c7f1.tar.gz
gcc-47eb5b329bf8e6ab2e939a4cedf5533d02a6c7f1.tar.bz2
params.c (set_param_value): Initialize the "set" field.
* params.c (set_param_value): Initialize the "set" field. * params.h (struct param_info): Add "set" field. (PARAM_SET_P): New macro. (PREFETCH_LATENCY, SIMULTANEOUS_PREFETCHES, L1_CACHE_SIZE, L1_CACHE_LINE_SIZE): New macros. * toplev.c (DEFPARAM): Initialize the "set" field. * tree-ssa-loop-prefetch.c (PREFETCH_LATENCY, SIMULTANEOUS_PREFETCHES): Removed. (PREFETCH_BLOCK): Use L1_CACHE_LINE_SIZE. (tree_ssa_prefetch_arrays): Dump the values of the parameters. * config/sparc/sparc.c: Include params.h. (sparc_override_options): Set SIMULTANEOUS_PREFETCHES and L1_CACHE_LINE_SIZE parameters. * config/sparc/sparc.h (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Removed. * config/i386/i386.h (PREFETCH_BLOCK, SIMULTANEOUS_PREFETCHES): Removed. * config/i386/i386.c: Include params.h. (k8_cost): Change default value for SIMULTANEOUS_PREFETCHES. (override_options): Set SIMULTANEOUS_PREFETCHES and L1_CACHE_LINE_SIZE parameters. * config/sh/sh.h (SIMULTANEOUS_PREFETCHES): Removed. (OPTIMIZATION_OPTIONS): Set SIMULTANEOUS_PREFETCHES and L1_CACHE_LINE_SIZE parameters. * config/ia64/ia64.c (ia64_optimization_options): Set SIMULTANEOUS_PREFETCHES and L1_CACHE_LINE_SIZE parameters. * config/ia64/ia64.h (SIMULTANEOUS_PREFETCHES, PREFETCH_BLOCK): Removed. * params.def (PARAM_PREFETCH_LATENCY, PARAM_SIMULTANEOUS_PREFETCHES, PARAM_L1_CACHE_SIZE, PARAM_L1_CACHE_LINE_SIZE): New params. * doc/invoke.texi: Document new params. From-SVN: r118728
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
-rw-r--r--gcc/tree-ssa-loop-prefetch.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
index f34214e..41ada26 100644
--- a/gcc/tree-ssa-loop-prefetch.c
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -115,19 +115,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Magic constants follow. These should be replaced by machine specific
numbers. */
-/* A number that should roughly correspond to the number of instructions
- executed before the prefetch is completed. */
-
-#ifndef PREFETCH_LATENCY
-#define PREFETCH_LATENCY 200
-#endif
-
-/* Number of prefetches that can run at the same time. */
-
-#ifndef SIMULTANEOUS_PREFETCHES
-#define SIMULTANEOUS_PREFETCHES 3
-#endif
-
/* True if write can be prefetched by a read prefetch. */
#ifndef WRITE_CAN_USE_READ_PREFETCH
@@ -140,10 +127,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define READ_CAN_USE_WRITE_PREFETCH 0
#endif
-/* Cache line size. Assumed to be a power of two. */
+/* The size of the block loaded by a single prefetch. Usually, this is
+ the same as cache line size (at the moment, we only consider one level
+ of cache hierarchy). */
#ifndef PREFETCH_BLOCK
-#define PREFETCH_BLOCK 32
+#define PREFETCH_BLOCK L1_CACHE_LINE_SIZE
#endif
/* Do we have a forward hardware sequential prefetching? */
@@ -1026,6 +1015,19 @@ tree_ssa_prefetch_arrays (struct loops *loops)
|| PREFETCH_BLOCK == 0)
return 0;
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Prefetching parameters:\n");
+ fprintf (dump_file, " simultaneous prefetches: %d\n",
+ SIMULTANEOUS_PREFETCHES);
+ fprintf (dump_file, " prefetch latency: %d\n", PREFETCH_LATENCY);
+ fprintf (dump_file, " L1 cache size: %d (%d bytes)\n",
+ L1_CACHE_SIZE, L1_CACHE_SIZE * L1_CACHE_LINE_SIZE);
+ fprintf (dump_file, " L1 cache line size: %d\n", L1_CACHE_LINE_SIZE);
+ fprintf (dump_file, " prefetch block size: %d\n", PREFETCH_BLOCK);
+ fprintf (dump_file, "\n");
+ }
+
initialize_original_copy_tables ();
if (!built_in_decls[BUILT_IN_PREFETCH])