From patchwork Thu Oct 27 23:28:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 122266 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 A6D15B6F18 for ; Fri, 28 Oct 2011 10:29:19 +1100 (EST) Received: (qmail 6208 invoked by alias); 27 Oct 2011 23:29:00 -0000 Received: (qmail 6090 invoked by uid 22791); 27 Oct 2011 23:28:57 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp25.services.sfr.fr (HELO smtp25.services.sfr.fr) (93.17.128.120) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 27 Oct 2011 23:28:42 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id 0882D7000072; Fri, 28 Oct 2011 01:28:41 +0200 (CEST) Received: from gimli.local (145.15.72.86.rev.sfr.net [86.72.15.145]) by msfrf2512.sfr.fr (SMTP Server) with ESMTP id C2685700008E; Fri, 28 Oct 2011 01:28:40 +0200 (CEST) X-SFR-UUID: 20111027232840796.C2685700008E@msfrf2512.sfr.fr MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20111027232840.18581.26566@gimli.local> In-Reply-To: <20111027232829.18581.89158@gimli.local> References: <20111027232818.18581.901@gimli.local> <20111027232829.18581.89158@gimli.local> Subject: [Patch, fortran] [02/66] inline sum and product: Prepare gfc_trans_preloop_setup Date: Fri, 28 Oct 2011 01:28:40 +0200 (CEST) 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-10-19 Mikael Morin * trans-array.c (gfc_trans_preloop_setup): Move code earlier. diff --git a/trans-array.c b/trans-array.c index 4b21476..91359e9 100644 --- a/trans-array.c +++ b/trans-array.c @@ -2876,6 +2876,17 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, if (dim == info->dimen - 1) { + i = loop->order[0]; + /* For the time being, the innermost loop is unconditionally on + the first dimension of the scalarization loop. */ + gcc_assert (i == 0); + stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); + + /* Calculate the stride of the innermost loop. Hopefully this will + allow the backend optimizers to do their stuff more effectively. + */ + info->stride0 = gfc_evaluate_now (stride, pblock); + /* For the outermost loop calculate the offset due to any elemental dimensions. It will have been initialized with the base offset of the array. */ @@ -2900,17 +2911,6 @@ gfc_trans_preloop_setup (gfc_loopinfo * loop, int dim, int flag, info->offset = gfc_evaluate_now (info->offset, pblock); } } - - i = loop->order[0]; - /* For the time being, the innermost loop is unconditionally on - the first dimension of the scalarization loop. */ - gcc_assert (i == 0); - stride = gfc_conv_array_stride (info->descriptor, info->dim[i]); - - /* Calculate the stride of the innermost loop. Hopefully this will - allow the backend optimizers to do their stuff more effectively. - */ - info->stride0 = gfc_evaluate_now (stride, pblock); } else {