i386.opt (prefetch_sse): New targetsave.
authorJan Hubicka <hubicka@ucw.cz>
Sat, 24 Jan 2015 06:26:46 +0000 (07:26 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sat, 24 Jan 2015 06:26:46 +0000 (06:26 +0000)
* i386.opt (prefetch_sse): New targetsave.
* i386.c (ix86_function_specific_save): Save prefetch_sse.
(ix86_function_specific_restore): Restore prefetch_sse and initialize
ix86_cost/ix86_tune_cost.

From-SVN: r220077

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.opt

index fb08101de987cbaa37eadf14100407fc135fbd88..77791a2a2fe74da14208703e2b1d1983fe968458 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-23  Jan Hubicka  <hubicka@ucw.cz>
+
+       * i386.opt (prefetch_sse): New targetsave.
+       * i386.c (ix86_function_specific_save): Save prefetch_sse.
+       (ix86_function_specific_restore): Restore prefetch_sse and initialize
+       ix86_cost/ix86_tune_cost.
+
 2015-01-23  David Malcolm  <dmalcolm@redhat.com>
 
        * config/rs6000/rs6000.c (rs6000_output_function_epilogue):
index d10d3ff36cccb289af4a224293bdff7eb038689a..82fc4c56588acfdc4a0134a04342d0150476430e 100644 (file)
@@ -4466,6 +4466,7 @@ ix86_function_specific_save (struct cl_target_option *ptr,
 {
   ptr->arch = ix86_arch;
   ptr->schedule = ix86_schedule;
+  ptr->prefetch_sse = x86_prefetch_sse;
   ptr->tune = ix86_tune;
   ptr->branch_cost = ix86_branch_cost;
   ptr->tune_defaulted = ix86_tune_defaulted;
@@ -4523,6 +4524,7 @@ ix86_function_specific_restore (struct gcc_options *opts,
   ix86_arch = (enum processor_type) ptr->arch;
   ix86_schedule = (enum attr_cpu) ptr->schedule;
   ix86_tune = (enum processor_type) ptr->tune;
+  x86_prefetch_sse = ptr->prefetch_sse;
   opts->x_ix86_branch_cost = ptr->branch_cost;
   ix86_tune_defaulted = ptr->tune_defaulted;
   ix86_arch_specified = ptr->arch_specified;
@@ -4553,6 +4555,13 @@ ix86_function_specific_restore (struct gcc_options *opts,
   opts->x_ix86_tune_memset_strategy = ptr->x_ix86_tune_memset_strategy;
   opts->x_ix86_tune_no_default = ptr->x_ix86_tune_no_default;
   opts->x_ix86_veclibabi_type = ptr->x_ix86_veclibabi_type;
+  ix86_tune_cost = processor_target_table[ix86_tune].cost;
+  /* TODO: ix86_cost should be chosen at instruction or function granuality
+     so for cold code we use size_cost even in !optimize_size compilation.  */
+  if (opts->x_optimize_size)
+    ix86_cost = &ix86_size_cost;
+  else
+    ix86_cost = ix86_tune_cost;
 
   /* Recreate the arch feature tests if the arch changed */
   if (old_arch != ix86_arch)
index 3c3a34dcb8b71a516be9b8b3635f59bc4ef73f0c..301430c2380e29aaa7c3a366dc9ab0f3fe587a08 100644 (file)
@@ -60,6 +60,10 @@ const char *x_ix86_tune_string
 TargetSave
 unsigned char schedule
 
+;; True if processor has SSE prefetch instruction.
+TargetSave
+unsigned char prefetch_sse
+
 ;; branch cost
 TargetSave
 unsigned char branch_cost