From patchwork Mon Jul 3 07:30:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 106880 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp5463930qge; Mon, 3 Jul 2017 00:32:27 -0700 (PDT) X-Received: by 10.99.2.78 with SMTP id 75mr9111617pgc.120.1499067147373; Mon, 03 Jul 2017 00:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499067147; cv=none; d=google.com; s=arc-20160816; b=RnYIY1EWDJ78QSRZHqgz5si77wuVBeZAQOfqeHILSdA/CaV6XeLEGaSl4YBr8nYoul MIdbmlI1lwcrfVdwjYj9vly3jiWscmQnzFP8WII/H9aewzm6ZJ27cbzJXh//d9bpaiv1 i+M2e9PuQm6sbqG6hOBBJNktg1xp4JQvKLPQL3Gom08kSIGCxF3T130+Z1GCjVpVSVmg N6Vx9PJ3RADrP8W/0ONeZr5D1R8m3OPgFC6MQ41A20AkYTUPOtWLH4fqqIklsiBhPHpK F94qZfWIfinrD94ZSoGNhk5bSe8d71t6TbDyk4Ua3LYz5HKIr63/YA/N5I/WZw+qE3Vk C+Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:user-agent:message-id:date:subject:mail-followup-to:to :from:delivered-to:sender:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=fmK+2npLQbcf/RqQHx/Ca0ApMHAK+hGpy/fWBiKUdFw=; b=EgpphaEzg6lhuF3xlw97wJKhcktwrWQTzOm/aE/EE7WCU6gMwixCq6wF/3obVveIBn vtz+o6dZqrgNuleY0oL6SgJr2Nqn8iHwHrfu2MlLQ0MB64qn6r4I+I1dc5fU+PMaQh23 5Mba1f2Uv7rSK3P80plReQhb24BgXcARAi2XP3/M2Wqh2AaByq6vBS9XeJ8HOe4gXeak niHu+9h3Q/abTaPAq5ELSTgu/iIq3POpYqV5f8x0m217QNLNRfUE2miKTszmpN8fYtp7 AxhrNRhfjjsQ4NJ0klOI4EG2F9hFERFfT3RxeVunH7Hcfc47PFHNoFFhD6oP0eiKmJeF +ojw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=dJMCzjIu; spf=pass (google.com: domain of gcc-patches-return-457407-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-457407-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id a1si12513824pll.285.2017.07.03.00.32.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Jul 2017 00:32:27 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-457407-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.b=dJMCzjIu; spf=pass (google.com: domain of gcc-patches-return-457407-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-457407-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type; q=dns; s= default; b=o59yLQMSn+G9BnRS33bIedr5lmd30kGY9VPuKu3Jt7ZgS2mPMOsAJ dQ2z6NbA+Tj3dRPTYgpMGIL09UjzMEJH89E02iC18HryUR7WJlIzb+zipTXW6lf7 A4B2DD8RQnBi4bmkil7++TIZQYngkVZCseZ4IJAiYK50UP8lcPwCn8= 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:from :to:subject:date:message-id:mime-version:content-type; s= default; bh=waXMEewYM6ZQyEgroNeJE9bzTug=; b=dJMCzjIuMmCZCRGzTzHz 78P2YwlOG2x0W6ogm/RgM1f7Cr+rVL74YnCSsWcGhiskwww2ob6yjUQJXqhu9cP+ eq1PofLKZq6Jnhi1cWzNnTCbx1WM8eHJK8LlgngkjMf7OViVQoAGzoK3zs9pCjVw AM1uGBS63lEg8DQKk7aIWOM= Received: (qmail 64587 invoked by alias); 3 Jul 2017 07:31:58 -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 63892 invoked by uid 89); 3 Jul 2017 07:31:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wr0-f181.google.com Received: from mail-wr0-f181.google.com (HELO mail-wr0-f181.google.com) (209.85.128.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 03 Jul 2017 07:31:02 +0000 Received: by mail-wr0-f181.google.com with SMTP id k67so228898580wrc.2 for ; Mon, 03 Jul 2017 00:30:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:mail-followup-to:subject:date:message-id :user-agent:mime-version; bh=fmK+2npLQbcf/RqQHx/Ca0ApMHAK+hGpy/fWBiKUdFw=; b=GvS1l6GdDDXenrf4xhUgmDyIxkpuyhUGnlzMU1k73agaHnouyfIKHPvnw8O+ep55pU Nccafs6fy7N8SXl2nL5jA9XJtFwvoQLU1RHoMszOKZ1JaJ0wcWqIyDoqOi9y/gnqsfb/ iPHFBlSqkgWKGjwLceLNiQqvsZ1oqiFeFMFAMz95zdxA7sCInM1ZsWoaFKoh9bqtuR3o +7Wu7k2FxX7YUiLmX/cklJ2sLHF+zOftstBjKxHkXSfG4B2q2dUFFbbTQBL8RoR++gUA 4E7WJZ0Y8sqxPTRdY938ecv+KGAjFizCATxXebVbPrEx9telV8aMsCtvTV1i4wF+pwl8 JLkg== X-Gm-Message-State: AKS2vOwNOx0I18g+eNFOyXk6GTbB45T/CnKMVaK7H1suRFNCsCsOkF+a ReXA7mvvW+KycKx+ip2Z+g== X-Received: by 10.223.179.13 with SMTP id j13mr33584782wrd.108.1499067045772; Mon, 03 Jul 2017 00:30:45 -0700 (PDT) Received: from localhost (92.40.248.165.threembb.co.uk. [92.40.248.165]) by smtp.gmail.com with ESMTPSA id n131sm19663834wmg.11.2017.07.03.00.30.44 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 03 Jul 2017 00:30:44 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@linaro.org Subject: [2/7] Make dr_analyze_innermost operate on innermost_loop_behavior Date: Mon, 03 Jul 2017 08:30:43 +0100 Message-ID: <871spyyo2k.fsf@linaro.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 This means that callers to dr_analyze_innermost don't need a full data_reference and don't need to fill in any fields beforehand. Tested on aarch64-linux-gnu and x86_64-linux-gnu. OK to install? Richard 2017-07-03 Richard Sandiford gcc/ * tree-data-ref.h (dr_analyze_innermost): Replace the dr argument with a "innermost_loop_behavior *" and refeence tree. * tree-data-ref.c (dr_analyze_innermost): Likewise. (create_data_ref): Update call accordingly. * tree-predcom.c (find_looparound_phi): Likewise. Index: gcc/tree-data-ref.h =================================================================== --- gcc/tree-data-ref.h 2017-07-03 07:53:58.106558668 +0100 +++ gcc/tree-data-ref.h 2017-07-03 08:03:19.181500132 +0100 @@ -322,7 +322,7 @@ #define DDR_DIST_VECT(DDR, I) \ #define DDR_REVERSED_P(DDR) (DDR)->reversed_p -bool dr_analyze_innermost (struct data_reference *, struct loop *); +bool dr_analyze_innermost (innermost_loop_behavior *, tree, struct loop *); extern bool compute_data_dependences_for_loop (struct loop *, bool, vec *, vec *, Index: gcc/tree-data-ref.c =================================================================== --- gcc/tree-data-ref.c 2017-07-03 07:57:44.485520457 +0100 +++ gcc/tree-data-ref.c 2017-07-03 08:03:19.181500132 +0100 @@ -864,13 +864,12 @@ dr_analyze_innermost (struct data_refere fold_convert (ssizetype, base_iv.step), fold_convert (ssizetype, offset_iv.step)); - DR_BASE_ADDRESS (dr) = canonicalize_base_object_address (base_iv.base); + drb->base_address = canonicalize_base_object_address (base_iv.base); - DR_OFFSET (dr) = fold_convert (ssizetype, offset_iv.base); - DR_INIT (dr) = init; - DR_STEP (dr) = step; - - DR_ALIGNED_TO (dr) = size_int (highest_pow2_factor (offset_iv.base)); + drb->offset = fold_convert (ssizetype, offset_iv.base); + drb->init = init; + drb->step = step; + drb->aligned_to = size_int (highest_pow2_factor (offset_iv.base)); if (dump_file && (dump_flags & TDF_DETAILS)) fprintf (dump_file, "success.\n"); Index: gcc/tree-predcom.c =================================================================== --- gcc/tree-predcom.c 2017-07-03 07:53:58.106558668 +0100 +++ gcc/tree-predcom.c 2017-07-03 08:03:19.181500132 +0100 @@ -1149,7 +1149,7 @@ find_looparound_phi (struct loop *loop, memset (&init_dr, 0, sizeof (struct data_reference)); DR_REF (&init_dr) = init_ref; DR_STMT (&init_dr) = phi; - if (!dr_analyze_innermost (&init_dr, loop)) + if (!dr_analyze_innermost (&DR_INNERMOST (&init_dr), init_ref, loop)) return NULL; if (!valid_initializer_p (&init_dr, ref->distance + 1, root->ref))