From patchwork Wed Nov 17 16:03:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frederik Harwath X-Patchwork-Id: 47831 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 495FA3858432 for ; Wed, 17 Nov 2021 16:20:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 1FEF43858410 for ; Wed, 17 Nov 2021 16:04:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FEF43858410 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: kVh7JX6IrfUSIddv47BwwGlwpkGuSlTLVfZrOANFaZJR/s/O4+0+y80l5uZbIa/o5H9xjRaxJD Z01HkG4o10sosl7CUJnd7dGuSrKhNFbtduWlfcEBXMgiRCB5MeI3bdGGX9rtGM6QIP52m60iau BKv7eWeF3BWAMDt+esquKQf1fpE50N5Gah1YhLj8lkH9dbLJ2LIT+mNdpa44aZfx7KUrilzuQe OpThFbcqH4MwWEbbOjQ3BIgWUjSwM3YwzFzMTa9O8YRq5yFyfBeyegTKpaxiieK0fHq0PYOWLQ 1ibH7sAVIrlCjdvmg6MqQ2oY X-IronPort-AV: E=Sophos;i="5.87,241,1631606400"; d="scan'208";a="68445391" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 17 Nov 2021 08:04:52 -0800 IronPort-SDR: wHfDCB6IuQHwK8Zta42QgC5nJVBGBx05eyn2nsna8fpTrNnTFtS3CJMV7vLSY/N8oglAv7+9X3 SM8Rd9+4jLdzIz9oxuN5ibUbBcTqTqaB9n/Hc34hZGua5Lf/Mb7qpO9VwgqPq3gfjdz/7bjblg 5mPSf3UR+PYSJ1QqnWNypUG78RQniXtZa813XicvZtuK3Ar4maIWLX8TsQGG1QTwJuFjl5C6LO +CiHuBcxHFPRGUu62Gui1rYs5aMsw+NvBd2NRqiR6T9ZmthzmCbwZSYLGi9uGRQn1PensTrO1h 1so= From: Frederik Harwath To: Subject: [OG11][committed][PATCH 18/22] openacc: Disable pass_pre on outlined functions analyzed by Graphite Date: Wed, 17 Nov 2021 17:03:26 +0100 Message-ID: <20211117160330.20029-18-frederik@codesourcery.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211117160330.20029-1-frederik@codesourcery.com> References: <20211117160330.20029-1-frederik@codesourcery.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) X-Spam-Status: No, score=-12.6 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.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 2aedc31e1d73..b904354e4c78 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -51,6 +51,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-dce.h" #include "tree-cfgcleanup.h" #include "alias.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 @@ -3736,6 +3737,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)