Rename DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT
authorRichard Sandiford <richard.sandiford@linaro.org>
Mon, 3 Jul 2017 13:36:36 +0000 (13:36 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 3 Jul 2017 13:36:36 +0000 (13:36 +0000)
This patch renames DR_ALIGNED_TO to DR_OFFSET_ALIGNMENT, to avoid
confusion with the upcoming DR_BASE_ALIGNMENT.  Nothing needed the
value as a tree, and the value is clipped to BIGGEST_ALIGNMENT
(maybe it should be MAX_OFILE_ALIGNMENT?) so we might as well use
an unsigned int instead.

2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/
* tree-data-ref.h (innermost_loop_behavior): Replace aligned_to
with offset_alignment.
(DR_ALIGNED_TO): Delete.
(DR_OFFSET_ALIGNMENT): New macro.
* tree-vectorizer.h (STMT_VINFO_DR_ALIGNED_TO): Delete.
(STMT_VINFO_DR_OFFSET_ALIGNMENT): New macro.
* tree-data-ref.c (dr_analyze_innermost): Update after above changes.
(create_data_ref): Likewise.
* tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
(vect_analyze_data_refs): Likewise.
* tree-if-conv.c (if_convertible_loop_p_1): Use memset before
creating dummy innermost behavior.

From-SVN: r249914

gcc/ChangeLog
gcc/tree-data-ref.c
gcc/tree-data-ref.h
gcc/tree-if-conv.c
gcc/tree-vect-data-refs.c
gcc/tree-vectorizer.h

index 5abc06de67cf8a82527023433903b37cf243ea82..b063bb49ebe5fcffae1f609bb1000d9eb6fd3891 100644 (file)
@@ -1,3 +1,18 @@
+2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>
+
+       * tree-data-ref.h (innermost_loop_behavior): Replace aligned_to
+       with offset_alignment.
+       (DR_ALIGNED_TO): Delete.
+       (DR_OFFSET_ALIGNMENT): New macro.
+       * tree-vectorizer.h (STMT_VINFO_DR_ALIGNED_TO): Delete.
+       (STMT_VINFO_DR_OFFSET_ALIGNMENT): New macro.
+       * tree-data-ref.c (dr_analyze_innermost): Update after above changes.
+       (create_data_ref): Likewise.
+       * tree-vect-data-refs.c (vect_compute_data_ref_alignment): Likewise.
+       (vect_analyze_data_refs): Likewise.
+       * tree-if-conv.c (if_convertible_loop_p_1): Use memset before
+       creating dummy innermost behavior.
+
 2017-07-03  Richard Sandiford  <richard.sandiford@linaro.org>
 
        * tree-data-ref.h (dr_analyze_innermost): Replace the dr argument
index 1545fdb90761c30620db59b0808dcb0262fa1029..c5cf0acabae2040e8b27b4f011a463fdc65c6797 100644 (file)
@@ -869,7 +869,7 @@ dr_analyze_innermost (innermost_loop_behavior *drb, tree ref,
   drb->offset = fold_convert (ssizetype, offset_iv.base);
   drb->init = init;
   drb->step = step;
-  drb->aligned_to = size_int (highest_pow2_factor (offset_iv.base));
+  drb->offset_alignment = highest_pow2_factor (offset_iv.base);
 
   if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "success.\n");
@@ -1084,8 +1084,8 @@ create_data_ref (loop_p nest, loop_p loop, tree memref, gimple *stmt,
       print_generic_expr (dump_file, DR_INIT (dr), TDF_SLIM);
       fprintf (dump_file, "\n\tstep: ");
       print_generic_expr (dump_file, DR_STEP (dr), TDF_SLIM);
-      fprintf (dump_file, "\n\taligned to: ");
-      print_generic_expr (dump_file, DR_ALIGNED_TO (dr), TDF_SLIM);
+      fprintf (dump_file, "\n\toffset alignment: %d",
+              DR_OFFSET_ALIGNMENT (dr));
       fprintf (dump_file, "\n\tbase_object: ");
       print_generic_expr (dump_file, DR_BASE_OBJECT (dr), TDF_SLIM);
       fprintf (dump_file, "\n");
index c8bb813e77cdd213bd17e1ecfd8b4298253b1bd2..45ecf9bc1726c946fc8c9ba29864920fe4b3e341 100644 (file)
@@ -52,9 +52,10 @@ struct innermost_loop_behavior
   tree init;
   tree step;
 
-  /* Alignment information.  ALIGNED_TO is set to the largest power of two
-     that divides OFFSET.  */
-  tree aligned_to;
+  /* The largest power of two that divides OFFSET, capped to a suitably
+     high value if the offset is zero.  This is a byte rather than a bit
+     quantity.  */
+  unsigned int offset_alignment;
 };
 
 /* Describes the evolutions of indices of the memory reference.  The indices
@@ -143,7 +144,7 @@ struct data_reference
 #define DR_INIT(DR)                (DR)->innermost.init
 #define DR_STEP(DR)                (DR)->innermost.step
 #define DR_PTR_INFO(DR)            (DR)->alias.ptr_info
-#define DR_ALIGNED_TO(DR)          (DR)->innermost.aligned_to
+#define DR_OFFSET_ALIGNMENT(DR)    (DR)->innermost.offset_alignment
 #define DR_INNERMOST(DR)           (DR)->innermost
 
 typedef struct data_reference *data_reference_p;
index ca29c762299a1d7835669fd209f368a99cad2213..d78731f16783a659aaca57b89d361b603151fede 100644 (file)
@@ -1441,11 +1441,8 @@ if_convertible_loop_p_1 (struct loop *loop, vec<data_reference_p> *refs)
                 || TREE_CODE (ref) == REALPART_EXPR)
            ref = TREE_OPERAND (ref, 0);
 
-          DR_BASE_ADDRESS (dr) = ref;
-          DR_OFFSET (dr) = NULL;
-          DR_INIT (dr) = NULL;
-          DR_STEP (dr) = NULL;
-          DR_ALIGNED_TO (dr) = NULL;
+         memset (&DR_INNERMOST (dr), 0, sizeof (DR_INNERMOST (dr)));
+         DR_BASE_ADDRESS (dr) = ref;
         }
       hash_memrefs_baserefs_and_store_DRs_read_written_info (dr);
     }
index 3b4d570cc6abc20caf22f1952328f2d605681cb8..091771cedbcee49a1a35c02c5d34085b73d86bed 100644 (file)
@@ -772,7 +772,7 @@ vect_compute_data_ref_alignment (struct data_reference *dr)
 
   alignment = TYPE_ALIGN_UNIT (vectype);
 
-  if ((compare_tree_int (drb->aligned_to, alignment) < 0)
+  if (drb->offset_alignment < alignment
       || !step_preserves_misalignment_p)
     {
       if (dump_enabled_p ())
@@ -3412,8 +3412,8 @@ again:
                                    {
                                      DR_OFFSET (newdr) = ssize_int (0);
                                      DR_STEP (newdr) = step;
-                                     DR_ALIGNED_TO (newdr)
-                                       = size_int (BIGGEST_ALIGNMENT);
+                                     DR_OFFSET_ALIGNMENT (newdr)
+                                       = BIGGEST_ALIGNMENT;
                                      dr = newdr;
                                      simd_lane_access = true;
                                    }
@@ -3644,8 +3644,8 @@ again:
          STMT_VINFO_DR_INIT (stmt_info) = outer_init;
          STMT_VINFO_DR_OFFSET (stmt_info) =
                                fold_convert (ssizetype, offset_iv.base);
-         STMT_VINFO_DR_ALIGNED_TO (stmt_info) =
-                               size_int (highest_pow2_factor (offset_iv.base));
+         STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info)
+           = highest_pow2_factor (offset_iv.base);
 
           if (dump_enabled_p ())
            {
@@ -3663,10 +3663,8 @@ again:
              dump_printf (MSG_NOTE, "\n\touter step: ");
              dump_generic_expr (MSG_NOTE, TDF_SLIM,
                                  STMT_VINFO_DR_STEP (stmt_info));
-             dump_printf (MSG_NOTE, "\n\touter aligned to: ");
-             dump_generic_expr (MSG_NOTE, TDF_SLIM,
-                                 STMT_VINFO_DR_ALIGNED_TO (stmt_info));
-             dump_printf (MSG_NOTE, "\n");
+             dump_printf (MSG_NOTE, "\n\touter offset alignment: %d\n",
+                          STMT_VINFO_DR_OFFSET_ALIGNMENT (stmt_info));
            }
        }
 
index 4a1e302fe36230ca7579acf3a89c1cfcda437306..15f5dc3a92558ad1cdc3336fdd78e82b8ddabff6 100644 (file)
@@ -709,7 +709,8 @@ STMT_VINFO_BB_VINFO (stmt_vec_info stmt_vinfo)
 #define STMT_VINFO_DR_INIT(S)              (S)->dr_wrt_vec_loop.init
 #define STMT_VINFO_DR_OFFSET(S)            (S)->dr_wrt_vec_loop.offset
 #define STMT_VINFO_DR_STEP(S)              (S)->dr_wrt_vec_loop.step
-#define STMT_VINFO_DR_ALIGNED_TO(S)        (S)->dr_wrt_vec_loop.aligned_to
+#define STMT_VINFO_DR_OFFSET_ALIGNMENT(S) \
+  (S)->dr_wrt_vec_loop.offset_alignment
 
 #define STMT_VINFO_IN_PATTERN_P(S)         (S)->in_pattern_p
 #define STMT_VINFO_RELATED_STMT(S)         (S)->related_stmt