From patchwork Wed Dec 15 15:54:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 1568405 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4JDgKp5lL7z9sXS for ; Thu, 16 Dec 2021 03:14:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 79A3B3857C42 for ; Wed, 15 Dec 2021 16:14:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 199B43857C44 for ; Wed, 15 Dec 2021 15:56:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 199B43857C44 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: 7xIfPcTPUmTGZwfDzgFSjWgOhYJBC1SoDWnkEY72Hk7g13cRqYOQl4Hh1VQs6zneBl4WXMxu0g h/OlyJT+tXNF+XspGAb5pjLz6SvgTUxj01W9aMW5w1U9EpqHeX1e7182MEFCNc5PuGBFDDa04p O9mU1Kk4eHAs/44+ZApc0s171aksKtkeiFya7yC0Sfnv1AOzZmZmGjUGPdLKGYOL+89T17rxcV LDRBWLCHijfIa7n6zO0cs1+OkBpxUsu5Catf2LyFRm3lk//ffuWTlZ8Lzdp0UcQEwSaiiTb+eM aqtduSDbB1sSM3SVcDd2DnAa X-IronPort-AV: E=Sophos;i="5.88,207,1635235200"; d="scan'208";a="69736613" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa2.mentor.iphmx.com with ESMTP; 15 Dec 2021 07:56:51 -0800 IronPort-SDR: jxEAtj+s/gjD6yw54ymPGIcFI7BhFP1jDVE09y+ylZmoPS5u2kiNRhhm0ztIPCOQf7sV9AoOZx j1afaZEIsd6zg/AesjlXUkYlxXxUcgVg/B/cz58mDD22TNKFH1ZgCzpqxZWIHlRWLxaa3ur4vW DshbsYEx4CxeuDA3scGAuBf7Ms0HyJ3maXzCSW0KZAvVSZsjr6Ov9tC8nnLHcdM34KW3PHw+fS LEL932oUUN/d3lbKtzMJ5uBmK/AG4LVI5Huzz2cdA/39ciGlN45BvrXnOHvEWBUYnhhA/RzgKX XN0= From: Frederik Harwath To: Subject: [PATCH 28/40] openacc: Disable pass_pre on outlined functions analyzed by Graphite Date: Wed, 15 Dec 2021 16:54:35 +0100 Message-ID: <20211215155447.19379-29-frederik@codesourcery.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211215155447.19379-1-frederik@codesourcery.com> References: <20211215155447.19379-1-frederik@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rguenther@suse.de, thomas@codesourcery.com Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The additional dependences introduced by partial redundancy elimination proper and by the code hoisting step of the pass very often cause Graphite to fail on OpenACC functions. On the other hand, the pass can also enable the analysis of OpenACC loops (cf. e.g. the loop-auto-transfer-4.f90 testcase), for instance, because full redundancy elimination removes definitions that would otherwise prevent the creation of runtime alias checks outside of the SCoP. This commit disables the actual partial redundancy elimination step as well as the code hoisting step of pass_pre on OpenACC functions that might be handled by Graphite. gcc/ChangeLog: * tree-ssa-pre.c (insert): Skip any insertions in OpenACC functions that might be processed by Graphite. --- gcc/tree-ssa-pre.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) -- 2.33.0 ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955 diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index dc55d868cc19..d61210fc2ee9 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -52,6 +52,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-cfgcleanup.h" #include "alias.h" #include "gimple-range.h" +#include "graphite-oacc.h" /* Even though this file is called tree-ssa-pre.c, we actually implement a bit more than just PRE here. All of them piggy-back @@ -3742,6 +3743,22 @@ do_hoist_insertion (basic_block block) static void insert (void) { + + /* The additional dependences introduced by the code insertions + can cause Graphite's dependence analysis to fail . Without + special handling of those dependences in Graphite, it seems + better to skip this step if OpenACC loops that need to be handled + by Graphite are found. Note that the full redundancy elimination + step of this pass is useful for the purpose of dependence + analysis, for instance, because it can remove definitions from + SCoPs that would otherwise prevent the creation of runtime alias + checks since those may only use definitions that are available + before the SCoP. */ + + if (oacc_function_p (cfun) + && ::graphite_analyze_oacc_function_p (cfun)) + return; + basic_block bb; FOR_ALL_BB_FN (bb, cfun)