From patchwork Tue May 24 18:51:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Pop X-Patchwork-Id: 97200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 14961B6F8D for ; Wed, 25 May 2011 04:52:16 +1000 (EST) Received: (qmail 29127 invoked by alias); 24 May 2011 18:51:51 -0000 Received: (qmail 28973 invoked by uid 22791); 24 May 2011 18:51:49 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=AWL, BAYES_50, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, FSL_RU_URL, NML_ADSP_CUSTOM_MED, RCVD_IN_DNSWL_LOW, RFC_ABUSE_POST, SPF_NEUTRAL X-Spam-Check-By: sourceware.org Received: from am1ehsobe006.messaging.microsoft.com (HELO AM1EHSOBE006.bigfish.com) (213.199.154.209) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 24 May 2011 18:51:30 +0000 Received: from mail6-am1-R.bigfish.com (10.3.201.240) by AM1EHSOBE006.bigfish.com (10.3.204.26) with Microsoft SMTP Server id 14.1.225.22; Tue, 24 May 2011 18:51:28 +0000 Received: from mail6-am1 (localhost.localdomain [127.0.0.1]) by mail6-am1-R.bigfish.com (Postfix) with ESMTP id EF2881990075; Tue, 24 May 2011 18:51:28 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zz936eK154dMzz1202hzz6d523h8275bhz2ei87h668h839h68o) X-Spam-TCS-SCL: 7:0 X-Forefront-Antispam-Report: CIP:163.181.249.108; KIP:(null); UIP:(null); IPVD:NLI; H:ausb3twp01.amd.com; RD:none; EFVD:NLI Received-SPF: neutral (mail6-am1: 163.181.249.108 is neither permitted nor denied by domain of gmail.com) client-ip=163.181.249.108; envelope-from=sebpop@gmail.com; helo=ausb3twp01.amd.com ; wp01.amd.com ; X-FB-DOMAIN-IP-MATCH: fail Received: from mail6-am1 (localhost.localdomain [127.0.0.1]) by mail6-am1 (MessageSwitch) id 1306263088606572_24815; Tue, 24 May 2011 18:51:28 +0000 (UTC) Received: from AM1EHSMHS011.bigfish.com (unknown [10.3.201.245]) by mail6-am1.bigfish.com (Postfix) with ESMTP id 86E5E1B68051; Tue, 24 May 2011 18:51:28 +0000 (UTC) Received: from ausb3twp01.amd.com (163.181.249.108) by AM1EHSMHS011.bigfish.com (10.3.207.111) with Microsoft SMTP Server id 14.1.225.22; Tue, 24 May 2011 18:51:26 +0000 X-M-MSG: Received: from sausexedgep02.amd.com (sausexedgep02-ext.amd.com [163.181.249.73]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by ausb3twp01.amd.com (Axway MailGate 3.8.1) with ESMTP id 2CEC510284C9; Tue, 24 May 2011 13:51:20 -0500 (CDT) Received: from sausexhtp02.amd.com (163.181.3.152) by sausexedgep02.amd.com (163.181.36.59) with Microsoft SMTP Server (TLS) id 8.3.106.1; Tue, 24 May 2011 13:51:31 -0500 Received: from storexhtp01.amd.com (172.24.4.3) by sausexhtp02.amd.com (163.181.3.152) with Microsoft SMTP Server (TLS) id 8.3.83.0; Tue, 24 May 2011 13:51:23 -0500 Received: from storexpf1.amd.com (10.1.1.18) by storexhtp01.amd.com (172.24.4.3) with Microsoft SMTP Server id 8.3.83.0; Tue, 24 May 2011 14:51:19 -0400 Received: from sausexmb1.amd.com ([163.181.3.156]) by storexpf1.amd.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 24 May 2011 14:51:18 -0400 Received: from napoca ([10.236.49.121]) by sausexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 24 May 2011 13:51:15 -0500 Received: by napoca (sSMTP sendmail emulation); Tue, 24 May 2011 13:51:15 -0500 From: Sebastian Pop To: CC: , Sebastian Pop Subject: [PATCH 1/5] Use zero_dim_array_p instead of graphite_artificial_array_p. Date: Tue, 24 May 2011 13:51:08 -0500 Message-ID: <1306263072-5821-2-git-send-email-sebpop@gmail.com> In-Reply-To: <1306263072-5821-1-git-send-email-sebpop@gmail.com> References: <1306263072-5821-1-git-send-email-sebpop@gmail.com> MIME-Version: 1.0 X-OriginatorOrg: amd.com X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 2011-05-24 Alexey Kravets * 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(-) 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 + + * 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 * 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;