From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4375 invoked by alias); 19 Jul 2009 06:18:45 -0000 Received: (qmail 4361 invoked by uid 22791); 19 Jul 2009 06:18:44 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.17.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 19 Jul 2009 06:18:38 +0000 Received: from d12nrmr1507.megacenter.de.ibm.com (d12nrmr1507.megacenter.de.ibm.com [9.149.167.1]) by mtagate1.de.ibm.com (8.13.1/8.13.1) with ESMTP id n6J6IY8l014788 for ; Sun, 19 Jul 2009 06:18:34 GMT Received: from d12av06.megacenter.de.ibm.com (d12av06.megacenter.de.ibm.com [9.149.165.230]) by d12nrmr1507.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6J6IWJw3580110 for ; Sun, 19 Jul 2009 08:18:34 +0200 Received: from d12av06.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av06.megacenter.de.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id n6J6IWqZ029912 for ; Sun, 19 Jul 2009 08:18:32 +0200 Received: from d12mc102.megacenter.de.ibm.com (d12mc102.megacenter.de.ibm.com [9.149.167.114]) by d12av06.megacenter.de.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id n6J6IWHd029909 for ; Sun, 19 Jul 2009 08:18:32 +0200 Subject: Vectorizing invariant data-ref X-KeepSent: B016B94E:CE4F6DF7-C22575F8:001843DB; type=4; name=$KeepSent To: gcc@gcc.gnu.org Message-ID: From: Revital1 Eres Date: Sun, 19 Jul 2009 06:18:00 -0000 MIME-Version: 1.0 Content-type: multipart/mixed; Boundary="0__=4DBBFF6BDF8BC54B8f9e8a93df938690918c4DBBFF6BDF8BC54B" Content-Disposition: inline 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-07/txt/msg00359.txt.bz2 --0__=4DBBFF6BDF8BC54B8f9e8a93df938690918c4DBBFF6BDF8BC54B Content-type: text/plain; charset=US-ASCII Content-length: 1182 Hello, The following snippet is from a f90 program which contains a loop that does not get vectorized. SUBROUTINE foo1(nx,ny,nz,arr2) USE globalvar_mod, ONLY : dyinv, xstart, xstop k=1 do j=1,ny do i=1,nx arr1(i,j,k) = arr2(i,j,k ) *dyinv end do end do END SUBROUTINE foo1 The vectorizer failure message is: base_address: &dyinv offset from base address: 0 constant offset from base address: 0 step: 0 aligned to: 128 base_object: dyinv FAILED as dr address is invariant test41.f90:24: note: get vectype with 2 units of type real(kind=8) test41.f90:24: note: vectype: vector real(kind=8) test41.f90:24: note: not vectorized: unhandled data-ref test41.f90:24: note: bad data references. test41.f90:7: note: vectorized 0 loops in function. I am not familiar with f90 at all; seemingly dyinv is a regular variable but according to the message in the dump file it's a reference. One option to vectorize this loop is to extend the vectorizer's versioning for aliasing capability to version the loop also in this case. Other suggestions will be appreciated. Thanks, Revital (See attached file: test41.f90.txt) --0__=4DBBFF6BDF8BC54B8f9e8a93df938690918c4DBBFF6BDF8BC54B Content-type: text/plain; name="test41.f90.txt" Content-Disposition: attachment; filename="test41.f90.txt" Content-transfer-encoding: base64 Content-length: 810 DQpNT0RVTEUgZm9vX21vZA0KVVNFIHBhcmFtZXRlcl9tb2QsIE9OTFkgOiBy ZnANCg0KSU1QTElDSVQgTk9ORQ0KDQpQVUJMSUMgZm9vMQ0KDQpQUklWQVRF DQpyZWFsKGtpbmQ9cmZwKSwgZGltZW5zaW9uKDosOiw6KSwgYWxsb2NhdGFi bGUgOjogYXJyMQ0KDQpDT05UQUlOUw0KU1VCUk9VVElORSBmb28xKG54LG55 LG56LGFycjIpDQpVU0UgZ2xvYmFsdmFyX21vZCwgT05MWSA6IGR5aW52LCB4 c3RhcnQsIHhzdG9wDQoNCmludGVnZXIsIGludGVudChpbikgOjogbngsIG55 LCBueg0KcmVhbChraW5kPXJmcCksIGludGVudChpbm91dCksICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJg0KICAg ICAgICAgZGltZW5zaW9uKHhzdGFydDp4c3RvcCsxLHhzdGFydDp4c3RvcCsx LHhzdGFydDp4c3RvcCsxKSA6OiBhcnIyDQoNCmludGVnZXIgOjogaSwgaiwg aw0KDQprPTENCmRvIGo9MSxueQ0KICBkbyBpPTEsbngNCg0KICAgIGFycjEo aSxqLGspID0gYXJyMihpLGosayAgKSAqZHlpbnYNCg0KICBlbmQgZG8NCmVu ZCBkbw0KDQoNCkVORCBTVUJST1VUSU5FIGZvbzENCg0KRU5EIE1PRFVMRSBm b29fbW9kDQoNCg== --0__=4DBBFF6BDF8BC54B8f9e8a93df938690918c4DBBFF6BDF8BC54B--