]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2013-11-21 Richard Biener <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 13:57:40 +0000 (13:57 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 21 Nov 2013 13:57:40 +0000 (13:57 +0000)
* tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
LOC_LINE): Remove wrappers and fix all users.
(struct _loop_vec_info): Remove loop_line_number member.
(LOOP_VINFO_LOC): Remove.
* tree-parloops.c, tree-vect-loop-manip.c, tree-vect-slp.c,
tree-vectorizer.c: Fix users of LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE
and LOC_LINE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205216 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-parloops.c
gcc/tree-vect-loop-manip.c
gcc/tree-vect-slp.c
gcc/tree-vectorizer.c
gcc/tree-vectorizer.h

index f9c4cc564fe952a279381f824c1732d044a6acf6..766421d978e418e9abe40a61df45e65714245caf 100644 (file)
@@ -1,3 +1,13 @@
+2013-11-21  Richard Biener  <rguenther@suse.de>
+
+       * tree-vectorizer.h (LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE,
+       LOC_LINE): Remove wrappers and fix all users.
+       (struct _loop_vec_info): Remove loop_line_number member.
+       (LOOP_VINFO_LOC): Remove.
+       * tree-parloops.c, tree-vect-loop-manip.c, tree-vect-slp.c,
+       tree-vectorizer.c: Fix users of LOC, UNKNOWN_LOC, EXPR_LOC, LOC_FILE
+       and LOC_LINE.
+
 2013-11-21  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-forwprop.c (simplify_vce): New function.
index d627c69f954bc2a29fbfd640fbd128bf946b6427..78b35df1b3a755a8e7b83d3b687b7448d387dbab 100644 (file)
@@ -2145,7 +2145,7 @@ parallelize_loops (void)
   reduction_info_table_type reduction_list;
   struct obstack parloop_obstack;
   HOST_WIDE_INT estimated;
-  LOC loop_loc;
+  source_location loop_loc;
 
   /* Do not parallelize loops in the functions created by parallelization.  */
   if (parallelized_function_p (cfun->decl))
@@ -2225,9 +2225,9 @@ parallelize_loops (void)
        else
          fprintf (dump_file, "parallelizing inner loop %d\n",loop->header->index);
        loop_loc = find_loop_location (loop);
-       if (loop_loc != UNKNOWN_LOC)
+       if (loop_loc != UNKNOWN_LOCATION)
          fprintf (dump_file, "\nloop at %s:%d: ",
-                  LOC_FILE (loop_loc), LOC_LINE (loop_loc));
+                  LOCATION_FILE (loop_loc), LOCATION_LINE (loop_loc));
       }
       gen_parallel_loop (loop, reduction_list,
                         n_threads, &niter_desc);
index a03b54c1f97d601dab97f5967ed80e33b19cbfb4..f5192e82d1475cdb7a5d86a2bf66905acfe41016 100644 (file)
@@ -661,7 +661,7 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
   bool insert_after;
   tree init = build_int_cst (TREE_TYPE (niters), 0);
   tree step = build_int_cst (TREE_TYPE (niters), 1);
-  LOC loop_loc;
+  source_location loop_loc;
   enum tree_code code;
 
   orig_cond = get_loop_exit_condition (loop);
@@ -691,9 +691,9 @@ slpeel_make_loop_iterate_ntimes (struct loop *loop, tree niters)
   loop_loc = find_loop_location (loop);
   if (dump_enabled_p ())
     {
-      if (LOCATION_LOCUS (loop_loc) != UNKNOWN_LOC)
-       dump_printf (MSG_NOTE, "\nloop at %s:%d: ", LOC_FILE (loop_loc),
-                    LOC_LINE (loop_loc));
+      if (LOCATION_LOCUS (loop_loc) != UNKNOWN_LOCATION)
+       dump_printf (MSG_NOTE, "\nloop at %s:%d: ", LOCATION_FILE (loop_loc),
+                    LOCATION_LINE (loop_loc));
       dump_gimple_stmt (MSG_NOTE, TDF_SLIM, cond_stmt, 0);
       dump_printf (MSG_NOTE, "\n");
     }
@@ -1057,7 +1057,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
   basic_block new_exit_bb;
   gimple_stmt_iterator gsi;
   edge exit_e = single_exit (loop);
-  LOC loop_loc;
+  source_location loop_loc;
   tree cost_pre_condition = NULL_TREE;
   /* There are many aspects to how likely the first loop is going to be executed.
      Without histogram we can't really do good job.  Simply set it to
@@ -1365,7 +1365,7 @@ slpeel_tree_peel_loop_to_edge (struct loop *loop,
    location is calculated.
    Return the loop location if succeed and NULL if not.  */
 
-LOC
+source_location
 find_loop_location (struct loop *loop)
 {
   gimple stmt = NULL;
@@ -1373,7 +1373,7 @@ find_loop_location (struct loop *loop)
   gimple_stmt_iterator si;
 
   if (!loop)
-    return UNKNOWN_LOC;
+    return UNKNOWN_LOCATION;
 
   stmt = get_loop_exit_condition (loop);
 
@@ -1385,7 +1385,7 @@ find_loop_location (struct loop *loop)
      try to estimate the loop location */
 
   if (!loop->header)
-    return UNKNOWN_LOC;
+    return UNKNOWN_LOCATION;
 
   bb = loop->header;
 
@@ -1396,7 +1396,7 @@ find_loop_location (struct loop *loop)
         return gimple_location (stmt);
     }
 
-  return UNKNOWN_LOC;
+  return UNKNOWN_LOCATION;
 }
 
 
@@ -2224,7 +2224,7 @@ vect_loop_versioning (loop_vec_info loop_vinfo,
   loop_version (loop, cond_expr, &condition_bb,
                prob, prob, REG_BR_PROB_BASE - prob, true);
 
-  if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
+  if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION
       && dump_enabled_p ())
     {
       if (version_alias)
index bd9e4e23e0deea8cbdea4f19b687b309a7841d02..c2e491241683d1f8283e6272219258174a13ca58 100644 (file)
@@ -48,23 +48,23 @@ along with GCC; see the file COPYING3.  If not see
 /* Extract the location of the basic block in the source code.
    Return the basic block location if succeed and NULL if not.  */
 
-LOC
+source_location
 find_bb_location (basic_block bb)
 {
   gimple stmt = NULL;
   gimple_stmt_iterator si;
 
   if (!bb)
-    return UNKNOWN_LOC;
+    return UNKNOWN_LOCATION;
 
   for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
     {
       stmt = gsi_stmt (si);
-      if (gimple_location (stmt) != UNKNOWN_LOC)
+      if (gimple_location (stmt) != UNKNOWN_LOCATION)
         return gimple_location (stmt);
     }
 
-  return UNKNOWN_LOC;
+  return UNKNOWN_LOCATION;
 }
 
 
index fea7086b6232884f014df134dca52eebb002eb99..7416aaa61350c89d6acd830034e3ec03225a5ac9 100644 (file)
@@ -79,7 +79,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "dbgcnt.h"
 
 /* Loop or bb location.  */
-LOC vect_location;
+source_location vect_location;
 
 /* Vector mapping GIMPLE stmt to stmt_vec_info. */
 vec<vec_void_p> stmt_vec_info_vec;
@@ -354,10 +354,11 @@ vectorize_loops (void)
       {
        loop_vec_info loop_vinfo;
        vect_location = find_loop_location (loop);
-        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
+        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION
            && dump_enabled_p ())
          dump_printf (MSG_NOTE, "\nAnalyzing loop at %s:%d\n",
-                       LOC_FILE (vect_location), LOC_LINE (vect_location));
+                       LOCATION_FILE (vect_location),
+                      LOCATION_LINE (vect_location));
 
        loop_vinfo = vect_analyze_loop (loop);
        loop->aux = loop_vinfo;
@@ -368,7 +369,7 @@ vectorize_loops (void)
         if (!dbg_cnt (vect_loop))
          break;
 
-        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOC
+        if (LOCATION_LOCUS (vect_location) != UNKNOWN_LOCATION
            && dump_enabled_p ())
           dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, vect_location,
                            "loop vectorized\n");
@@ -390,7 +391,7 @@ vectorize_loops (void)
          }
       }
 
-  vect_location = UNKNOWN_LOC;
+  vect_location = UNKNOWN_LOCATION;
 
   statistics_counter_event (cfun, "Vectorized loops", num_vectorized_loops);
   if (dump_enabled_p ()
@@ -549,7 +550,7 @@ increase_alignment (void)
 {
   struct varpool_node *vnode;
 
-  vect_location = UNKNOWN_LOC;
+  vect_location = UNKNOWN_LOCATION;
 
   /* Increase the alignment of all global arrays for vectorization.  */
   FOR_EACH_DEFINED_VARIABLE (vnode)
index 1297fab6cfeb9dde6fbba5f44d782925fb1d4738..23c4d88beb338acfa15512071d66176bd02e4f4d 100644 (file)
@@ -25,12 +25,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "target.h"
 #include "hash-table.h"
 
-typedef source_location LOC;
-#define UNKNOWN_LOC UNKNOWN_LOCATION
-#define EXPR_LOC(e) EXPR_LOCATION (e)
-#define LOC_FILE(l) LOCATION_FILE (l)
-#define LOC_LINE(l) LOCATION_LINE (l)
-
 /* Used for naming of new temporaries.  */
 enum vect_var_kind {
   vect_simple_var,
@@ -273,9 +267,6 @@ typedef struct _loop_vec_info {
   /* Unrolling factor  */
   int vectorization_factor;
 
-  /* The loop location in the source.  */
-  LOC loop_line_number;
-
   /* Unknown DRs according to which loop was peeled.  */
   struct data_reference *unaligned_dr;
 
@@ -343,6 +334,10 @@ typedef struct _loop_vec_info {
      this.  */
   bool peeling_for_gaps;
 
+  /* When the number of iterations is not a multiple of the vector size
+     we need to peel off iterations at the end to form an epilogue loop.  */
+  bool peeling_for_niter;
+
   /* Reductions are canonicalized so that the last operand is the reduction
      operand.  If this places a constant into RHS1, this decanonicalizes
      GIMPLE for other phases, so we must track when this has occurred and
@@ -369,7 +364,6 @@ typedef struct _loop_vec_info {
 #define LOOP_PEELING_FOR_ALIGNMENT(L)      (L)->peeling_for_alignment
 #define LOOP_VINFO_UNALIGNED_DR(L)         (L)->unaligned_dr
 #define LOOP_VINFO_MAY_MISALIGN_STMTS(L)   (L)->may_misalign_stmts
-#define LOOP_VINFO_LOC(L)                  (L)->loop_line_number
 #define LOOP_VINFO_MAY_ALIAS_DDRS(L)       (L)->may_alias_ddrs
 #define LOOP_VINFO_COMP_ALIAS_DDRS(L)      (L)->comp_alias_ddrs
 #define LOOP_VINFO_GROUPED_STORES(L)       (L)->grouped_stores
@@ -925,7 +919,7 @@ unlimited_cost_model ()
 }
 
 /* Source location */
-extern LOC vect_location;
+extern source_location vect_location;
 
 /*-----------------------------------------------------------------*/
 /* Function prototypes.                                            */
@@ -941,7 +935,7 @@ extern void vect_do_peeling_for_loop_bound (loop_vec_info, tree, tree,
                                            unsigned int, bool);
 extern void vect_do_peeling_for_alignment (loop_vec_info, tree,
                                           unsigned int, bool);
-extern LOC find_loop_location (struct loop *);
+extern source_location find_loop_location (struct loop *);
 extern bool vect_can_advance_ivs_p (loop_vec_info);
 
 /* In tree-vect-stmts.c.  */
@@ -1072,7 +1066,7 @@ extern void vect_detect_hybrid_slp (loop_vec_info);
 extern void vect_get_slp_defs (vec<tree> , slp_tree,
                               vec<vec<tree> > *, int);
 
-extern LOC find_bb_location (basic_block);
+extern source_location find_bb_location (basic_block);
 extern bb_vec_info vect_slp_analyze_bb (basic_block);
 extern void vect_slp_transform_bb (basic_block);