From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22709 invoked by alias); 2 Jun 2009 12:15:14 -0000 Received: (qmail 22696 invoked by uid 22791); 2 Jun 2009 12:15:12 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate5.de.ibm.com (HELO mtagate5.de.ibm.com) (195.212.29.154) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Jun 2009 12:15:05 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.14.3/8.13.8) with ESMTP id n52CEJeP387610 for ; Tue, 2 Jun 2009 12:14:19 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n52CEJnJ3326070 for ; Tue, 2 Jun 2009 14:14:19 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n52CEJtB000310 for ; Tue, 2 Jun 2009 14:14:19 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n52CEJHT000302; Tue, 2 Jun 2009 14:14:19 +0200 In-Reply-To: <4f5553710905310644y22561aa5s4b8482990360842e@mail.gmail.com> Subject: Re: Inner loop unable to compute sufficient information during vectorization To: Abhishek Shrivastav Cc: gcc@gcc.gnu.org Message-ID: From: Ira Rosen Date: Tue, 02 Jun 2009 12:15:00 -0000 MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-06/txt/msg00021.txt.bz2 Abhishek Shrivastav wrote on 31/05/2009 16:44:34: > In this case, I think that Outer loop could be vectorized as there is > no dependency in the loop,the access pattern is simple enough and > there is unit stride in both the loops. Current version 4.4.* is not > doing outer loop vectorization. The memory accesses are consecutive in the inner loop and strided in the outer loop. Therefore, inner loop vectorization is preferable in this case (and also strided accesses are not yet supported in outer loop vectorization). Ira > > On Tue, May 26, 2009 at 5:57 PM, Ira Rosen wrote: > > > > > > gcc-owner@gcc.gnu.org wrote on 25/05/2009 21:53:41: > > > >> for a loop like > >> > >> 1 =A0 =A0 =A0 =A0 for(i=3D0;i >> 2 =A0 =A0 =A0 =A0 =A0 for(j=3D0;j >> 3 =A0 =A0 =A0 =A0 =A0 =A0 =A0 a[i][j] =3D a[i][j]+b[i][j]; > >> > >> GCC 4.3.* is unable to get the information for the inner loop that > >> array reference 'a' =A0is alias of each other and generates code for > >> runtime aliasing check during vectorization. > > > > Both current trunk and GCC4.4 vectorize the inner loop without any runtime > > alias checks. > > > >> Is it necessary to > >> recompute all information in loop_vec_info in function > >> vect_analyze_ref for analysis of inner loop also, as most of the > >> information is similar for the outer loop for the program. > > > > Maybe you are right, and it is possible to extract at least part of the > > information for the inner loop from the outer loop information. > > > >> > >> Similarly, outer loop is able to compute correct chrec i.e. NULL , for > >> array 'a' reference, while innerloop has chrec as chrec_dont_know, and > >> therfore complaint about runtime alias check. > > > > The chrecs are not the same for inner and outer loops, so it is reasonable > > that the results of the data dependence tests will be different. > > In this case, however, it seems to be a bug. > > > > Ira > > > > > > > >