statistics.h (CXX_MEM_STAT_INFO): New define.
authorRichard Guenther <rguenther@suse.de>
Tue, 18 Sep 2012 09:17:27 +0000 (09:17 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Sep 2012 09:17:27 +0000 (09:17 +0000)
2012-09-18  Richard Guenther  <rguenther@suse.de>

* statistics.h (CXX_MEM_STAT_INFO): New define.
* gimple.h (gimple_build_assign_with_ops_stat,
gimple_build_assign_with_ops, gimple_build_assign_with_ops3):
Turn into an overload of the function gimple_build_assign_with_ops.
* gimple.c (gimple_build_assign_with_ops_stat): Rename to ...
(gimple_build_assign_with_ops): ... this.
* tree-ssa-loop-im.c (move_computations_stmt): Adjust.
* tree-ssa-math-opts.c (convert_mult_to_fma): Likewise.
* tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
(vect_permute_load_chain): Likewise.
* tree-vect-generic.c (expand_vector_divmod): Likewise.
* tree-vect-patterns.c (vect_recog_dot_prod_pattern): Likewise.
(vect_recog_divmod_pattern): Likewise.
(vect_recog_mixed_size_cond_pattern): Likewise.
(adjust_bool_pattern): Likewise.
* tree-vect-slp.c (vect_create_mask_and_perm): Likewise.
* tree-vect-stmts.c (vectorizable_operation): Likewise.
(permute_vec_elements): Likewise.
(vectorizable_load): Likewise.

From-SVN: r191415

gcc/ChangeLog
gcc/gimple.c
gcc/gimple.h
gcc/statistics.h
gcc/tree-ssa-loop-im.c
gcc/tree-ssa-math-opts.c
gcc/tree-vect-data-refs.c
gcc/tree-vect-generic.c
gcc/tree-vect-patterns.c
gcc/tree-vect-slp.c
gcc/tree-vect-stmts.c

index 3298a9f5436fc2682726e2fdfd1cd3aac0a6e8b7..de3e9c1c8264d29d89ec65085b72ad4f9b99d76c 100644 (file)
@@ -1,3 +1,25 @@
+2012-09-18  Richard Guenther  <rguenther@suse.de>
+
+       * statistics.h (CXX_MEM_STAT_INFO): New define.
+       * gimple.h (gimple_build_assign_with_ops_stat,
+       gimple_build_assign_with_ops, gimple_build_assign_with_ops3):
+       Turn into an overload of the function gimple_build_assign_with_ops.
+       * gimple.c (gimple_build_assign_with_ops_stat): Rename to ...
+       (gimple_build_assign_with_ops): ... this.
+       * tree-ssa-loop-im.c (move_computations_stmt): Adjust.
+       * tree-ssa-math-opts.c (convert_mult_to_fma): Likewise.
+       * tree-vect-data-refs.c (vect_permute_store_chain): Likewise.
+       (vect_permute_load_chain): Likewise.
+       * tree-vect-generic.c (expand_vector_divmod): Likewise.
+       * tree-vect-patterns.c (vect_recog_dot_prod_pattern): Likewise.
+       (vect_recog_divmod_pattern): Likewise.
+       (vect_recog_mixed_size_cond_pattern): Likewise.
+       (adjust_bool_pattern): Likewise.
+       * tree-vect-slp.c (vect_create_mask_and_perm): Likewise.
+       * tree-vect-stmts.c (vectorizable_operation): Likewise.
+       (permute_vec_elements): Likewise.
+       (vectorizable_load): Likewise.
+
 2012-09-17  Paul Koning  <ni1d@arrl.net>
 
        * doc/invoke.text (-feliminate-unused-debug-types): Update to
index 7c702cad71a883b79e32efb4cd1f07cd8e7ea088..2bb4b67ab542dbb8c1b8b42a36478279ecac7fff 100644 (file)
@@ -424,8 +424,8 @@ gimple_build_assign_stat (tree lhs, tree rhs MEM_STAT_DECL)
   tree op1, op2, op3;
 
   extract_ops_from_tree_1 (rhs, &subcode, &op1, &op2, &op3);
-  return gimple_build_assign_with_ops_stat (subcode, lhs, op1, op2, op3
-                                           PASS_MEM_STAT);
+  return gimple_build_assign_with_ops (subcode, lhs, op1, op2, op3
+                                      PASS_MEM_STAT);
 }
 
 
@@ -434,8 +434,8 @@ gimple_build_assign_stat (tree lhs, tree rhs MEM_STAT_DECL)
    GIMPLE_UNARY_RHS or GIMPLE_SINGLE_RHS.  */
 
 gimple
-gimple_build_assign_with_ops_stat (enum tree_code subcode, tree lhs, tree op1,
-                                   tree op2, tree op3 MEM_STAT_DECL)
+gimple_build_assign_with_ops (enum tree_code subcode, tree lhs, tree op1,
+                             tree op2, tree op3 MEM_STAT_DECL)
 {
   unsigned num_ops;
   gimple p;
@@ -463,6 +463,14 @@ gimple_build_assign_with_ops_stat (enum tree_code subcode, tree lhs, tree op1,
   return p;
 }
 
+gimple
+gimple_build_assign_with_ops (enum tree_code subcode, tree lhs, tree op1,
+                             tree op2 MEM_STAT_DECL)
+{
+  return gimple_build_assign_with_ops (subcode, lhs, op1, op2, NULL_TREE
+                                      PASS_MEM_STAT);
+}
+
 
 /* Build a new GIMPLE_ASSIGN tuple and append it to the end of *SEQ_P.
 
index 797cd944450848f9b551e13142cbdb02076dcf25..58696896050eb69bc8fdbb6ecf9fedf489f0a109 100644 (file)
@@ -744,12 +744,12 @@ gimple gimple_build_assign_stat (tree, tree MEM_STAT_DECL);
 
 void extract_ops_from_tree_1 (tree, enum tree_code *, tree *, tree *, tree *);
 
-gimple gimple_build_assign_with_ops_stat (enum tree_code, tree, tree,
-                                         tree, tree MEM_STAT_DECL);
-#define gimple_build_assign_with_ops(c,o1,o2,o3)                       \
-  gimple_build_assign_with_ops_stat (c, o1, o2, o3, NULL_TREE MEM_STAT_INFO)
-#define gimple_build_assign_with_ops3(c,o1,o2,o3,o4)                   \
-  gimple_build_assign_with_ops_stat (c, o1, o2, o3, o4 MEM_STAT_INFO)
+gimple
+gimple_build_assign_with_ops (enum tree_code, tree,
+                             tree, tree CXX_MEM_STAT_INFO);
+gimple
+gimple_build_assign_with_ops (enum tree_code, tree,
+                             tree, tree, tree CXX_MEM_STAT_INFO);
 
 gimple gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
 #define gimple_build_debug_bind(var,val,stmt)                  \
index 8ec0a990003487c6b1edf113a6b6fa857df5c2a1..6bb8166165c11dacb86835db65a6ad01adb1ad70 100644 (file)
 #define PASS_MEM_STAT , ALONE_PASS_MEM_STAT
 #define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT
 #define MEM_STAT_INFO , ALONE_MEM_STAT_INFO
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+#define CXX_MEM_STAT_INFO , const char * _loc_name = __builtin_FILE (), int _loc_line = __builtin_LINE (), const char * _loc_function = __builtin_FUNCTION ()
+#else
+#define CXX_MEM_STAT_INFO , const char * _loc_name = __FILE__, int _loc_line = __LINE__, const char * _loc_function = NULL
+#endif
 #else
 #define ALONE_MEM_STAT_DECL void
 #define ALONE_FINAL_MEM_STAT_DECL GCC_MEM_STAT_ARGUMENTS
@@ -49,6 +54,7 @@
 #define PASS_MEM_STAT
 #define FINAL_PASS_MEM_STAT , ALONE_FINAL_PASS_MEM_STAT
 #define MEM_STAT_INFO ALONE_MEM_STAT_INFO
+#define CXX_MEM_STAT_INFO
 #endif
 
 struct function;
index 67cab3a31ae7f8f0d415543133c0a2a0b61b41a8..e76e64398eae0b6693ca79ee34a194b21a54f3c1 100644 (file)
@@ -1273,9 +1273,9 @@ move_computations_stmt (struct dom_walk_data *dw_data,
          gcc_assert (arg0 && arg1);
          t = build2 (gimple_cond_code (cond), boolean_type_node,
                      gimple_cond_lhs (cond), gimple_cond_rhs (cond));
-         new_stmt = gimple_build_assign_with_ops3 (COND_EXPR,
-                                                   gimple_phi_result (stmt),
-                                                   t, arg0, arg1);
+         new_stmt = gimple_build_assign_with_ops (COND_EXPR,
+                                                  gimple_phi_result (stmt),
+                                                  t, arg0, arg1);
          SSA_NAME_DEF_STMT (gimple_phi_result (stmt)) = new_stmt;
          *((unsigned int *)(dw_data->global_data)) |= TODO_cleanup_cfg;
        }
index 2020bb138cc8bca36d677f34b8bfe129042c66cf..16ff397d47d2b49335bbc50c5c37d5f8b500a3c0 100644 (file)
@@ -2604,10 +2604,10 @@ convert_mult_to_fma (gimple mul_stmt, tree op1, tree op2)
                                           true, NULL_TREE, true,
                                           GSI_SAME_STMT);
 
-      fma_stmt = gimple_build_assign_with_ops3 (FMA_EXPR,
-                                               gimple_assign_lhs (use_stmt),
-                                               mulop1, op2,
-                                               addop);
+      fma_stmt = gimple_build_assign_with_ops (FMA_EXPR,
+                                              gimple_assign_lhs (use_stmt),
+                                              mulop1, op2,
+                                              addop);
       gsi_replace (&gsi, fma_stmt, true);
       widen_mul_stats.fmas_inserted++;
     }
index 4a5624e10926a79058756babcda13123d69a2d76..09704694dea82d3108f4533b7dab205344f23cab 100644 (file)
@@ -4170,8 +4170,8 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain,
             high = VEC_PERM_EXPR <vect1, vect2, {0, nelt, 1, nelt+1, ...}>  */
          high = make_temp_ssa_name (vectype, NULL, "vect_inter_high");
          perm_stmt
-           = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, high,
-                                            vect1, vect2, perm_mask_high);
+           = gimple_build_assign_with_ops (VEC_PERM_EXPR, high,
+                                           vect1, vect2, perm_mask_high);
          vect_finish_stmt_generation (stmt, perm_stmt, gsi);
          VEC_replace (tree, *result_chain, 2*j, high);
 
@@ -4180,8 +4180,8 @@ vect_permute_store_chain (VEC(tree,heap) *dr_chain,
                                                 nelt*3/2+1, ...}>  */
          low = make_temp_ssa_name (vectype, NULL, "vect_inter_low");
          perm_stmt
-           = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, low,
-                                            vect1, vect2, perm_mask_low);
+           = gimple_build_assign_with_ops (VEC_PERM_EXPR, low,
+                                           vect1, vect2, perm_mask_low);
          vect_finish_stmt_generation (stmt, perm_stmt, gsi);
          VEC_replace (tree, *result_chain, 2*j+1, low);
        }
@@ -4618,17 +4618,17 @@ vect_permute_load_chain (VEC(tree,heap) *dr_chain,
 
          /* data_ref = permute_even (first_data_ref, second_data_ref);  */
          data_ref = make_temp_ssa_name (vectype, NULL, "vect_perm_even");
-         perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
-                                                    first_vect, second_vect,
-                                                    perm_mask_even);
+         perm_stmt = gimple_build_assign_with_ops (VEC_PERM_EXPR, data_ref,
+                                                   first_vect, second_vect,
+                                                   perm_mask_even);
          vect_finish_stmt_generation (stmt, perm_stmt, gsi);
          VEC_replace (tree, *result_chain, j/2, data_ref);
 
          /* data_ref = permute_odd (first_data_ref, second_data_ref);  */
          data_ref = make_temp_ssa_name (vectype, NULL, "vect_perm_odd");
-         perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
-                                                    first_vect, second_vect,
-                                                    perm_mask_odd);
+         perm_stmt = gimple_build_assign_with_ops (VEC_PERM_EXPR, data_ref,
+                                                   first_vect, second_vect,
+                                                   perm_mask_odd);
          vect_finish_stmt_generation (stmt, perm_stmt, gsi);
          VEC_replace (tree, *result_chain, j/2+length/2, data_ref);
        }
index b217b1123e97087af70fc2f07822f834087aafbd..85fb3a29bca07beabcf227bb454f57cebdbb2101 100644 (file)
@@ -667,8 +667,8 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, tree op0,
                                         << shifts[i]) - 1);
              cst = build_vector (type, vec);
              addend = make_ssa_name (type, NULL);
-             stmt = gimple_build_assign_with_ops3 (VEC_COND_EXPR, addend,
-                                                   cond, cst, zero);
+             stmt = gimple_build_assign_with_ops (VEC_COND_EXPR, addend,
+                                                  cond, cst, zero);
              gsi_insert_before (gsi, stmt, GSI_SAME_STMT);
            }
        }
index 1b78a54c42e952ab9bc526e06d1bffca918b40af..ef65c3f885865db438333d6b782122c14de3d678 100644 (file)
@@ -413,8 +413,8 @@ vect_recog_dot_prod_pattern (VEC (gimple, heap) **stmts, tree *type_in,
 
   /* Pattern detected. Create a stmt to be used to replace the pattern: */
   var = vect_recog_temp_ssa_var (type, NULL);
-  pattern_stmt = gimple_build_assign_with_ops3 (DOT_PROD_EXPR, var,
-                                               oprnd00, oprnd01, oprnd1);
+  pattern_stmt = gimple_build_assign_with_ops (DOT_PROD_EXPR, var,
+                                              oprnd00, oprnd01, oprnd1);
 
   if (vect_print_dump_info (REPORT_DETAILS))
     {
@@ -1688,12 +1688,12 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
          tree var = vect_recog_temp_ssa_var (itype, NULL);
          tree shift;
          def_stmt
-           = gimple_build_assign_with_ops3 (COND_EXPR, var, cond,
-                                            fold_build2 (MINUS_EXPR, itype,
-                                                         oprnd1,
-                                                         build_int_cst (itype,
-                                                                        1)),
-                                            build_int_cst (itype, 0));
+           = gimple_build_assign_with_ops (COND_EXPR, var, cond,
+                                           fold_build2 (MINUS_EXPR, itype,
+                                                        oprnd1,
+                                                        build_int_cst (itype,
+                                                                       1)),
+                                           build_int_cst (itype, 0));
          new_pattern_def_seq (stmt_vinfo, def_stmt);
          var = vect_recog_temp_ssa_var (itype, NULL);
          def_stmt
@@ -1716,9 +1716,9 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
            {
              signmask = vect_recog_temp_ssa_var (itype, NULL);
              def_stmt
-               = gimple_build_assign_with_ops3 (COND_EXPR, signmask, cond,
-                                                build_int_cst (itype, 1),
-                                                build_int_cst (itype, 0));
+               = gimple_build_assign_with_ops (COND_EXPR, signmask, cond,
+                                               build_int_cst (itype, 1),
+                                               build_int_cst (itype, 0));
              append_pattern_def_seq (stmt_vinfo, def_stmt);
            }
          else
@@ -1732,9 +1732,9 @@ vect_recog_divmod_pattern (VEC (gimple, heap) **stmts,
              tree var = vect_recog_temp_ssa_var (utype, NULL);
 
              def_stmt
-               = gimple_build_assign_with_ops3 (COND_EXPR, var, cond,
-                                                build_int_cst (utype, -1),
-                                                build_int_cst (utype, 0));
+               = gimple_build_assign_with_ops (COND_EXPR, var, cond,
+                                               build_int_cst (utype, -1),
+                                               build_int_cst (utype, 0));
              def_stmt_vinfo
                = new_stmt_vec_info (def_stmt, loop_vinfo, bb_vinfo);
              set_vinfo_for_stmt (def_stmt, def_stmt_vinfo);
@@ -2172,11 +2172,11 @@ vect_recog_mixed_size_cond_pattern (VEC (gimple, heap) **stmts, tree *type_in,
     }
 
   def_stmt
-    = gimple_build_assign_with_ops3 (COND_EXPR,
-                                    vect_recog_temp_ssa_var (itype, NULL),
-                                    unshare_expr (cond_expr),
-                                    fold_convert (itype, then_clause),
-                                    fold_convert (itype, else_clause));
+    = gimple_build_assign_with_ops (COND_EXPR,
+                                   vect_recog_temp_ssa_var (itype, NULL),
+                                   unshare_expr (cond_expr),
+                                   fold_convert (itype, then_clause),
+                                   fold_convert (itype, else_clause));
   pattern_stmt
     = gimple_build_assign_with_ops (NOP_EXPR,
                                    vect_recog_temp_ssa_var (type, NULL),
@@ -2476,10 +2476,10 @@ adjust_bool_pattern (tree var, tree out_type, tree trueval,
        gcc_checking_assert (useless_type_conversion_p (itype,
                                                        TREE_TYPE (trueval)));
       pattern_stmt
-       = gimple_build_assign_with_ops3 (COND_EXPR,
-                                        vect_recog_temp_ssa_var (itype, NULL),
-                                        cond_expr, trueval,
-                                        build_int_cst (itype, 0));
+       = gimple_build_assign_with_ops (COND_EXPR,
+                                       vect_recog_temp_ssa_var (itype, NULL),
+                                       cond_expr, trueval,
+                                       build_int_cst (itype, 0));
       break;
     }
 
index 11dbdfb5a02436f3c1f513beeb0eccc5ee6be8d4..83cbb49fb223ab6786ec81218cef97a593f3f77b 100644 (file)
@@ -2672,8 +2672,8 @@ vect_create_mask_and_perm (gimple stmt, gimple next_scalar_stmt,
       second_vec = VEC_index (tree, dr_chain, second_vec_indx);
 
       /* Generate the permute statement.  */
-      perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, perm_dest,
-                                                first_vec, second_vec, mask);
+      perm_stmt = gimple_build_assign_with_ops (VEC_PERM_EXPR, perm_dest,
+                                               first_vec, second_vec, mask);
       data_ref = make_ssa_name (perm_dest, perm_stmt);
       gimple_set_lhs (perm_stmt, data_ref);
       vect_finish_stmt_generation (stmt, perm_stmt, gsi);
index ab4a26c2b28e3586ae5d2c5042896fd8b5d730e0..210e5b572faaa641a2fe7db4beffc2f5cd06aa06 100644 (file)
@@ -3702,8 +3702,8 @@ vectorizable_operation (gimple stmt, gimple_stmt_iterator *gsi,
                  ? VEC_index (tree, vec_oprnds1, i) : NULL_TREE);
          vop2 = ((op_type == ternary_op)
                  ? VEC_index (tree, vec_oprnds2, i) : NULL_TREE);
-         new_stmt = gimple_build_assign_with_ops3 (code, vec_dest,
-                                                   vop0, vop1, vop2);
+         new_stmt = gimple_build_assign_with_ops (code, vec_dest,
+                                                  vop0, vop1, vop2);
          new_temp = make_ssa_name (vec_dest, new_stmt);
          gimple_assign_set_lhs (new_stmt, new_temp);
          vect_finish_stmt_generation (stmt, new_stmt, gsi);
@@ -4235,8 +4235,8 @@ permute_vec_elements (tree x, tree y, tree mask_vec, gimple stmt,
   data_ref = make_ssa_name (perm_dest, NULL);
 
   /* Generate the permute statement.  */
-  perm_stmt = gimple_build_assign_with_ops3 (VEC_PERM_EXPR, data_ref,
-                                            x, y, mask_vec);
+  perm_stmt = gimple_build_assign_with_ops (VEC_PERM_EXPR, data_ref,
+                                           x, y, mask_vec);
   vect_finish_stmt_generation (stmt, perm_stmt, gsi);
 
   return data_ref;
@@ -5047,9 +5047,9 @@ vectorizable_load (gimple stmt, gimple_stmt_iterator *gsi, gimple *vec_stmt,
                    realignment_token = dataref_ptr;
                  vec_dest = vect_create_destination_var (scalar_dest, vectype);
                  new_stmt
-                   = gimple_build_assign_with_ops3 (REALIGN_LOAD_EXPR,
-                                                    vec_dest, msq, lsq,
-                                                    realignment_token);
+                   = gimple_build_assign_with_ops (REALIGN_LOAD_EXPR,
+                                                   vec_dest, msq, lsq,
+                                                   realignment_token);
                  new_temp = make_ssa_name (vec_dest, new_stmt);
                  gimple_assign_set_lhs (new_stmt, new_temp);
                  vect_finish_stmt_generation (stmt, new_stmt, gsi);