re PR tree-optimization/50969 (17% degradation in 168.wupwise for interleave via...
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Mon, 6 Feb 2012 21:39:34 +0000 (21:39 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Mon, 6 Feb 2012 21:39:34 +0000 (21:39 +0000)
2012-02-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

PR tree-optimization/50969
* tree-vect-stmts.c (vect_model_store_cost): Correct statement cost to
use vec_perm rather than vector_stmt.
(vect_model_load_cost): Likewise.
* config/i386/i386.c (ix86_builtin_vectorization_cost): Change cost of
vec_perm to be the same as other vector statements.
* config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
cost of vec_perm for TARGET_VSX.

From-SVN: r183944

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/rs6000/rs6000.c
gcc/tree-vect-stmts.c

index 28f130f35011fc52563353f2511bbb7d341476e0..9bacd9de42efda08c5f935f022b0ed5a46a7cc02 100644 (file)
@@ -1,3 +1,14 @@
+2012-02-06  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+
+       PR tree-optimization/50969
+       * tree-vect-stmts.c (vect_model_store_cost): Correct statement cost to
+       use vec_perm rather than vector_stmt.
+       (vect_model_load_cost): Likewise.
+       * config/i386/i386.c (ix86_builtin_vectorization_cost): Change cost of
+       vec_perm to be the same as other vector statements.
+       * config/rs6000/rs6000.c (rs6000_builtin_vectorization_cost): Revise
+       cost of vec_perm for TARGET_VSX.
+
 2012-02-06  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52115
index a50d8712ecbe0c7a0ef774fce8bcb568c3e2732a..009dd5301345024f17abe6f497014b1180cb0373 100644 (file)
@@ -35336,7 +35336,7 @@ ix86_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
         return ix86_cost->cond_not_taken_branch_cost;
 
       case vec_perm:
-        return 1;
+        return ix86_cost->vec_stmt_cost;
 
       default:
         gcc_unreachable ();
index 751ce2cdc1e83e9d00e3f5578c033d48e8971aa3..4190b25817ce4d59a78f4ed1e5e767bf39fc3677 100644 (file)
@@ -3540,9 +3540,13 @@ rs6000_builtin_vectorization_cost (enum vect_cost_for_stmt type_of_cost,
       case vec_to_scalar:
       case scalar_to_vec:
       case cond_branch_not_taken:
-      case vec_perm:
         return 1;
 
+      case vec_perm:
+       if (!TARGET_VSX)
+         return 1;
+       return 2;
+
       case cond_branch_taken:
         return 3;
 
index 6ce742cdfa73f74f12792f46dc8cf888f29e53ae..e854da58373102c2aeea792ca99546ff571b410a 100644 (file)
@@ -882,7 +882,7 @@ vect_model_store_cost (stmt_vec_info stmt_info, int ncopies,
     {
       /* Uses a high and low interleave operation for each needed permute.  */
       inside_cost = ncopies * exact_log2(group_size) * group_size
-        * vect_get_stmt_cost (vector_stmt);
+        * vect_get_stmt_cost (vec_perm);
 
       if (vect_print_dump_info (REPORT_COST))
         fprintf (vect_dump, "vect_model_store_cost: strided group_size = %d .",
@@ -988,7 +988,7 @@ vect_model_load_cost (stmt_vec_info stmt_info, int ncopies, bool load_lanes_p,
     {
       /* Uses an even and odd extract operations for each needed permute.  */
       inside_cost = ncopies * exact_log2(group_size) * group_size
-       * vect_get_stmt_cost (vector_stmt);
+       * vect_get_stmt_cost (vec_perm);
 
       if (vect_print_dump_info (REPORT_COST))
         fprintf (vect_dump, "vect_model_load_cost: strided group_size = %d .",