OSDN Git Service

* tree-data-ref.c (analyze_array_indexes, analyze_array,
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 May 2005 14:50:35 +0000 (14:50 +0000)
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 10 May 2005 14:50:35 +0000 (14:50 +0000)
init_data_ref, access_functions_are_affine_or_constant_p,
free_data_refs): Use VEC instead of VARRAY.
* tree-data-ref.h (data_reference): Change the type of
access_fns to VEC(tree,gc)*.
(DR_ACCESS_FN, DR_NUM_DIMENSIONS): Use VEC instead of VARRAY.

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

gcc/ChangeLog
gcc/tree-data-ref.c
gcc/tree-data-ref.h

index 8d97a6c..7e817dd 100644 (file)
@@ -4,6 +4,13 @@
        config/sh/sh.md, config/sh/superh.h: Fix comment typos.
        * doc/invoke.texi: Fix typos.
 
+       * tree-data-ref.c (analyze_array_indexes, analyze_array,
+       init_data_ref, access_functions_are_affine_or_constant_p,
+       free_data_refs): Use VEC instead of VARRAY.
+       * tree-data-ref.h (data_reference): Change the type of
+       access_fns to VEC(tree,gc)*.
+       (DR_ACCESS_FN, DR_NUM_DIMENSIONS): Use VEC instead of VARRAY.
+
 2005-05-10  Gabor Loki <loki@gcc.gnu.org>
 
        PR c/17913
index 8ef5c51..e62519a 100644 (file)
@@ -523,7 +523,7 @@ estimate_niter_from_size_of_data (struct loop *loop,
 
 static tree
 analyze_array_indexes (struct loop *loop,
-                      varray_type *access_fns, 
+                      VEC(tree,heap) **access_fns, 
                       tree ref, tree stmt)
 {
   tree opnd0, opnd1;
@@ -542,7 +542,7 @@ analyze_array_indexes (struct loop *loop,
   if (loop->estimated_nb_iterations == NULL_TREE)
     estimate_niter_from_size_of_data (loop, opnd0, access_fn, stmt);
   
-  VARRAY_PUSH_TREE (*access_fns, access_fn);
+  VEC_safe_push (tree, heap, *access_fns, access_fn);
   
   /* Recursively record other array access functions.  */
   if (TREE_CODE (opnd0) == ARRAY_REF)
@@ -575,7 +575,7 @@ analyze_array (tree stmt, tree ref, bool is_read)
   
   DR_STMT (res) = stmt;
   DR_REF (res) = ref;
-  VARRAY_TREE_INIT (DR_ACCESS_FNS (res), 3, "access_fns");
+  DR_ACCESS_FNS (res) = VEC_alloc (tree, heap, 3);
   DR_BASE_NAME (res) = analyze_array_indexes 
     (loop_containing_stmt (stmt), &(DR_ACCESS_FNS (res)), ref, stmt);
   DR_IS_READ (res) = is_read;
@@ -610,9 +610,9 @@ init_data_ref (tree stmt,
   
   DR_STMT (res) = stmt;
   DR_REF (res) = ref;
-  VARRAY_TREE_INIT (DR_ACCESS_FNS (res), 5, "access_fns");
+  DR_ACCESS_FNS (res) = VEC_alloc (tree, heap, 5);
   DR_BASE_NAME (res) = base;
-  VARRAY_PUSH_TREE (DR_ACCESS_FNS (res), access_fn);
+  VEC_quick_push (tree, DR_ACCESS_FNS (res), access_fn);
   DR_IS_READ (res) = is_read;
   
   if (dump_file && (dump_flags & TDF_DETAILS))
@@ -2124,11 +2124,12 @@ static bool
 access_functions_are_affine_or_constant_p (struct data_reference *a)
 {
   unsigned int i;
-  varray_type fns = DR_ACCESS_FNS (a);
+  VEC(tree,heap) **fns = &DR_ACCESS_FNS (a);
+  tree t;
   
-  for (i = 0; i < VARRAY_ACTIVE_SIZE (fns); i++)
-    if (!evolution_function_is_constant_p (VARRAY_TREE (fns, i))
-       && !evolution_function_is_affine_multivariate_p (VARRAY_TREE (fns, i)))
+  for (i = 0; VEC_iterate (tree, *fns, i, t); i++)
+    if (!evolution_function_is_constant_p (t)
+       && !evolution_function_is_affine_multivariate_p (t))
       return false;
   
   return true;
@@ -2457,8 +2458,7 @@ free_data_refs (varray_type datarefs)
        VARRAY_GENERIC_PTR (datarefs, i);
       if (dr)
        {
-         if (DR_ACCESS_FNS (dr))
-           varray_clear (DR_ACCESS_FNS (dr));
+         VEC_free (tree, heap, DR_ACCESS_FNS (dr));
          free (dr);
        }
     }
index d9b7d59..66d6644 100644 (file)
@@ -36,7 +36,7 @@ struct data_reference
   tree base_name;
   
   /* A list of chrecs.  */
-  varray_type access_fns;
+  VEC(tree,heap) *access_fns;
 
   /* Auxiliary info specific to a pass.  */
   int aux;
@@ -50,8 +50,8 @@ struct data_reference
 #define DR_REF(DR) DR->ref
 #define DR_BASE_NAME(DR) DR->base_name
 #define DR_ACCESS_FNS(DR) DR->access_fns
-#define DR_ACCESS_FN(DR, I) VARRAY_TREE (DR_ACCESS_FNS (DR), I)
-#define DR_NUM_DIMENSIONS(DR) VARRAY_ACTIVE_SIZE (DR_ACCESS_FNS (DR))
+#define DR_ACCESS_FN(DR, I) VEC_index (tree, DR_ACCESS_FNS (DR), I)
+#define DR_NUM_DIMENSIONS(DR) VEC_length (tree, DR_ACCESS_FNS (DR))
 #define DR_IS_READ(DR) DR->is_read
 
 enum data_dependence_direction {