From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32471 invoked by alias); 21 Nov 2011 16:57:35 -0000 Received: (qmail 32461 invoked by uid 22791); 21 Nov 2011 16:57:34 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 Nov 2011 16:57:03 +0000 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id pALGv2N1013494 for ; Mon, 21 Nov 2011 16:57:02 GMT Received: from d06av01.portsmouth.uk.ibm.com (d06av01.portsmouth.uk.ibm.com [9.149.37.212]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id pALGv1dS2355328 for ; Mon, 21 Nov 2011 16:57:01 GMT Received: from d06av01.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id pALGv156006428 for ; Mon, 21 Nov 2011 09:57:01 -0700 Received: from d06ml319.portsmouth.uk.ibm.com (d06ml319.portsmouth.uk.ibm.com [9.149.76.146]) by d06av01.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id pALGv10i006425; Mon, 21 Nov 2011 09:57:01 -0700 In-Reply-To: <20111121150754.GJ27242@tyan-ft48-01.lab.bos.redhat.com> References: <20111121125707.GG27242@tyan-ft48-01.lab.bos.redhat.com> <20111121135915.GH27242@tyan-ft48-01.lab.bos.redhat.com> <20111121150754.GJ27242@tyan-ft48-01.lab.bos.redhat.com> To: Jakub Jelinek Cc: GCC Patches , Richard Guenther MIME-Version: 1.0 Subject: Re: [PATCH, take 2] Fix PR tree-optimization/49960 ,Fix self data dependence X-KeepSent: 5254828B:916BFFBC-C225794F:00579335; type=4; name=$KeepSent From: Razya Ladelsky Message-ID: Date: Mon, 21 Nov 2011 17:25:00 -0000 Content-Type: text/plain; charset="US-ASCII" X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-11/txt/msg02121.txt.bz2 Jakub Jelinek wrote on 21/11/2011 05:07:54 PM: > From: Jakub Jelinek > To: Razya Ladelsky/Haifa/IBM@IBMIL > Cc: GCC Patches , Richard Guenther > > Date: 21/11/2011 05:08 PM > Subject: Re: [PATCH, take 2] Fix PR tree-optimization/49960 ,Fix > self data dependence > > On Mon, Nov 21, 2011 at 04:54:09PM +0200, Razya Ladelsky wrote: > > Although compute_affine_dependence() can't do anything meaningful for the > > gather data refs, > > it may still be assigning values to the dependence relation structure, if > > you need to use them. > > Therefore I did not skip the call to compute_self_dependence(), which > > indeed calls > > compute_affine_depepndence(). > > > > > > If you think it's redundant, we can remove it. > > It is not just redundant, but harmful. compute_affine_dependence assumes > that base and offset are simple IVs, that is not true for gather deps. > So please do remove it. > > Jakub > Jakub, I have some non-affine cases for which compute_affine_dependence is called (as it is called for ALL dependences from compte_all_depepndences()), and no harm is done. I looked a little bit closer into the code, and this is what happens for non affine accesses: initialize_data_dependence_relation() assigns DDR_ARE_DEPENDENT (res) = chrec_dont_know for the dr. Then, compute_affine_depepndence() tests if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE), and does nothing otherwise. Since the dr was initialized with chrec_dont_know, no harm is done. Anyway, since it is useless for your gather case, I'll just remove it, along with compute_self_dependence(). OK? Thanks, Razya