From patchwork Fri Aug 14 09:25:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aditya K X-Patchwork-Id: 507320 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A718F14010F for ; Fri, 14 Aug 2015 19:25:42 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=a0UTB5SD; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:from:to:cc:subject:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; q=dns; s= default; b=EGdbUU4CDd/IPnOjIAprXKY0QHK43fyk/mxwm5NKZOxVdn17hPBuf s6TWl082aCr0U6jTXZKuj9vbrOFnq+pdapH1m+VVoLnHCWusYx3+uTch/6HZ2ikY 2gmrlLyflT4HOHNEtwT9ed+el6AVpUmCSkbrmUgNqoDAaiFXwxshik= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:from:to:cc:subject:date:in-reply-to:references :content-type:content-transfer-encoding:mime-version; s=default; bh=GyTHLDjORYhko32PCutRf4dYbeI=; b=a0UTB5SDOFs67BkXKDqeW0Q2sOuv fWOsVi5npT/RNhVKMwZmTeGJkrRWbo2kw/pxyUn2JV8UGi+Bc4W8YS9edq2S2iZ+ qgdh38Ej56YXk7ms2J8aNxSNE1rM6QjH+cDXjk8cul1HpbZas1Hs9P5G/35vkkkS 24ORwu+MUW0bfik= Received: (qmail 55968 invoked by alias); 14 Aug 2015 09:25:33 -0000 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 Received: (qmail 55958 invoked by uid 89); 14 Aug 2015 09:25:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: BLU004-OMC4S36.hotmail.com Received: from blu004-omc4s36.hotmail.com (HELO BLU004-OMC4S36.hotmail.com) (65.55.111.175) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Fri, 14 Aug 2015 09:25:31 +0000 Received: from BLU179-W80 ([65.55.111.136]) by BLU004-OMC4S36.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Fri, 14 Aug 2015 02:25:29 -0700 X-TMN: [n6z85YQ/mK62qYs8/EYs8UVlUDXBba/q] Message-ID: From: Aditya K To: Richard Biener CC: Tobias Grosser , GCC Patches , "s.pop@samsung.com" , Sebastian Pop Subject: RE: [PATCH] [graphite] Constrain only on INTEGER_TYPE Date: Fri, 14 Aug 2015 09:25:29 +0000 In-Reply-To: References: <1439411605-10344-1-git-send-email-hiraditya@msn.com>, <55CBAF7F.3050909@grosser.es>, , , MIME-Version: 1.0 ---------------------------------------- > Date: Fri, 14 Aug 2015 09:31:32 +0200 > Subject: Re: [PATCH] [graphite] Constrain only on INTEGER_TYPE > From: richard.guenther@gmail.com > To: hiraditya@msn.com > CC: tobias@grosser.es; gcc-patches@gcc.gnu.org; s.pop@samsung.com; sebpop@gmail.com > > On Thu, Aug 13, 2015 at 7:56 PM, Aditya K wrote: >> >> >>> Date: Thu, 13 Aug 2015 12:02:43 +0200 >>> Subject: Re: [PATCH] [graphite] Constrain only on INTEGER_TYPE >>> From: richard.guenther@gmail.com >>> To: tobias@grosser.es >>> CC: hiraditya@msn.com; gcc-patches@gcc.gnu.org; s.pop@samsung.com; >>> sebpop@gmail.com >>> >>> On Wed, Aug 12, 2015 at 10:41 PM, Tobias Grosser >>> wrote: >>>> On 08/12/2015 10:33 PM, Aditya Kumar wrote: >>>>> >>>>> Passes bootstrap, no regressions. >>>>> >>>>> With this patch gcc bootstraps with graphite. >>>>> make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange >>>>> -floop-block" >>>> >>>> >>>> LGTM, but please use a longer sentence to explain what you do. >>> >>> As the middle-end generally freely exchanges INTEGER_TYPE >>> ENUMERAL_TYPE and BOOLEAN_TYPE >>> you want to use INTEGRAL_TYPE_P here. >>> >> >> Thanks. >> I tried INTEGRAL_TYPE_P, and that fails bootstrap. After a little bit of >> debugging I figured out that it is >> ENUMERAL_TYPE that causes the failure (miscompile) in tree-vect-data-refs.c. >> I can add INTEGER_TYPE and BOOLEAN_TYPE (bootstrap passes with these). But >> that would be inconsistent with the type-checks at other places in >> graphite-*.c. >> Currently, we are only checking for INTEGER_TYPE at other places. > > This is weird - the code you replace did allow both ENUMERAL_TYPE and > BOOLEAN_TYPE. > > my suggestion was > > /* We can not handle REAL_TYPE. Failed for pr39260. */ > - || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE) > + || ! INTEGRAL_TYPE_P (TREE_TYPE (op)) > > you also need to adjust the comment btw. This is exactly what I did and that resulted in miscompile. Then out of curiosity I tried to debug by putting  /* We can not handle REAL_TYPE. Failed for pr39260. */  - || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE)  + || TREE_CODE (TREE_TYPE (op)) != INTEGER_TYPE)  + || TREE_CODE (TREE_TYPE (op)) != BOOLEAN_TYPE)) And that passed bootstrap. Update patch: Passes bootstrap, no regressions. With this patch gcc bootstraps with graphite. make BOOT_CFLAGS="-g -O2 -fgraphite-identity -floop-interchange -floop-block" gcc/ChangeLog: 2015-08-12 Aditya Kumar * graphite-scop-detection.c (stmt_simple_for_scop_p): Constrain only on INTEGER_TYPE ---  gcc/graphite-scop-detection.c | 4 ++--  1 file changed, 2 insertions(+), 2 deletions(-) --  2.1.4 > > Richard. > >> -Aditya >> >> >>> RIchard. >>> >>>> Tobias diff --git a/gcc/graphite-scop-detection.c b/gcc/graphite-scop-detection.c index fb7247e..0f02a71 100644 --- a/gcc/graphite-scop-detection.c +++ b/gcc/graphite-scop-detection.c @@ -409,8 +409,8 @@ stmt_simple_for_scop_p (basic_block scop_entry, loop_p outermost_loop,    {      tree op = gimple_op (stmt, i);      if (!graphite_can_represent_expr (scop_entry, loop, op) - /* We can not handle REAL_TYPE. Failed for pr39260.  */ - || TREE_CODE (TREE_TYPE (op)) == REAL_TYPE) + /* We can only constrain on integer type.  */ + || (TREE_CODE (TREE_TYPE (op)) != INTEGER_TYPE))        {   if (dump_file && (dump_flags & TDF_DETAILS))    {