Patchwork [1/5] Use zero_dim_array_p instead of graphite_artificial_array_p.

login
register
mail settings
Submitter Sebastian Pop
Date May 24, 2011, 6:51 p.m.
Message ID <1306263072-5821-2-git-send-email-sebpop@gmail.com>
Download mbox | patch
Permalink /patch/97200/
State New
Headers show

Comments

Sebastian Pop - May 24, 2011, 6:51 p.m.
2011-05-24  Alexey Kravets  <kayrick@ispras.ru>

	* graphite-opencl.c (opencl_private_var_name_p): Removed.
	(graphite_artificial_array_p): Removed.
	(opencl_data_create): Use zero_dim_array_p instead of
	graphite_artificial_array_p.
---
 gcc/ChangeLog.graphite |    7 +++++++
 gcc/graphite-opencl.c  |   38 +-------------------------------------
 2 files changed, 8 insertions(+), 37 deletions(-)

Patch

diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite
index b1fa8ca..50948b6 100644
--- a/gcc/ChangeLog.graphite
+++ b/gcc/ChangeLog.graphite
@@ -1,3 +1,10 @@ 
+2011-05-24  Alexey Kravets  <kayrick@ispras.ru>
+
+	* graphite-opencl.c (opencl_private_var_name_p): Removed.
+	(graphite_artificial_array_p): Removed.
+	(opencl_data_create): Use zero_dim_array_p instead of
+	graphite_artificial_array_p.
+
 2011-01-25  Sebastian Pop  <sebastian.pop@amd.com>
 
 	* graphite-opencl.c (opencl_create_function_call): Use cl_khr_fp64
diff --git a/gcc/graphite-opencl.c b/gcc/graphite-opencl.c
index ea894ee..53704d2 100644
--- a/gcc/graphite-opencl.c
+++ b/gcc/graphite-opencl.c
@@ -330,42 +330,6 @@  zero_dim_array_p (tree var)
   return TREE_INT_CST_LOW (up_bound) == 0;
 }
 
-/* Check whether NAME is the name of the artificial array, which can be
-   privatized.  */
-
-static bool
-opencl_private_var_name_p (const char *name)
-{
-  static const char *general_reduction = "General_Reduction";
-  static const char *close_phi = "Close_Phi";
-  static const char *cross_bb = "Cross_BB_scalar_dependence";
-  static const char *commutative = "Commutative_Associative_Reduction";
-
-  if (!name)
-    return false;
-
-  return
-    ((strstr (name, general_reduction) == name)
-     || (strstr (name, close_phi) == name)
-     || (strstr (name, commutative) == name)
-     || (strstr (name, cross_bb) == name));
-}
-
-/* Check whether VAR is an artificial array, which can be privatized.  */
-
-static bool
-graphite_artificial_array_p (tree var)
-{
-  tree name;
-
-  if (TREE_CODE (var) != VAR_DECL
-      || !zero_dim_array_p (var)
-      || !(name = DECL_NAME (var)))
-    return false;
-
-  return opencl_private_var_name_p (IDENTIFIER_POINTER (name));
-}
-
 /* Get depth of type TYPE scalar (base) part.  */
 
 static int
@@ -393,7 +357,7 @@  opencl_data_create (tree var, tree size)
   opencl_data tmp = XNEW (struct opencl_data_def);
   tree type = TREE_TYPE (var);
 
-  tmp->can_be_private = graphite_artificial_array_p (var);
+  tmp->can_be_private = zero_dim_array_p (var);
   tmp->exact_object = var;
 
   tmp->supported = TREE_CODE (var) == VAR_DECL || TREE_CODE (var) == SSA_NAME;