From patchwork Wed Apr 19 12:14:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 85364 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp341230vqo; Wed, 19 Apr 2023 05:16:47 -0700 (PDT) X-Google-Smtp-Source: AKy350Z/uyp0rypOlFSRRupMGdTVUdJWQCkcIMA+29veh/KpotCWps4G5wf0Hp6uSLvdQ5Y4qgJ2 X-Received: by 2002:a17:906:cc53:b0:94a:7716:e649 with SMTP id mm19-20020a170906cc5300b0094a7716e649mr13677633ejb.13.1681906607311; Wed, 19 Apr 2023 05:16:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681906607; cv=none; d=google.com; s=arc-20160816; b=jV3kH4k+hGAuuoo6iaCoZBQbCL8uUy+S1JQc7zy9VHltYqshDYT1sTlKjW3Nm1QWbT 2C8KNL/TvBneuB3Te5eewcJo/zbU/h4kh9qDDAWSt2uZhrKFV2GUz1D5cvJN52MX6X8H vjkeyGivWKHYjy16KfV+t+Pd13WoyKo7b9ROLRsB3cFVyGVxwp8klFUJ1KFHc4znx2IB Kxs6p5wm6oe82gO9CuPd0eWVZDzLFj2NSuT/3Ejq2HJ28g6TwoOmxevX7sfT/tTdsjKV 6rbkjNHmNn/v02yXt8UFImgjeVn7I9AzGuQyaJjnOXbc+lIVh3orUsxfWzAWmvB0QqPG sY/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:sender:errors-to:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:user-agent:subject:to:date:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=CYw4tywIz/zjPGxu4Y0LrubUHk2XXora0prhIoX//Q4=; b=geeBfJImiDaDK7o/yrkMwo3/tBVnzPhO5QqLk0/YyzRi0lwQDv0ApIDSFHWtp/33Mw dHY+43YFhO70bUl4NNDUNbYsGyHzULET1lb0x5KoklatoBF0l0VY+C/KcvecEhm164de HBfmfgyPRd1v3a6FU3kvP08u1ier6EHr/GBmkR5eunRTF3gIpDrvL4aS/KwzLR5VG3DO S9hSsSX+8zmcpUll9gjKxrxl62hUuRvTNZkRH2Z6qqMLFjt62cQUSo+A3PNX5/E35q5a KXBXBjKkHFoyaw03t3tZKlLd61o5VLUosw1w+yFkHeSalGdhe0KUlrcq7Vx0Ikt2kfSP yiwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xRohdb71; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id j23-20020aa7de97000000b0050477dfb22bsi17154672edv.565.2023.04.19.05.16.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Apr 2023 05:16:47 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=xRohdb71; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C45363857038 for ; Wed, 19 Apr 2023 12:16:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C45363857038 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681906579; bh=CYw4tywIz/zjPGxu4Y0LrubUHk2XXora0prhIoX//Q4=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xRohdb71oZBjcj5Oud/gSSCNe8Z0YoOq3Fvj2ASl2DtPq+SZ2dJ5YanqTn1OtNNTu kKIJ6SUJOFmMgj1XTF8/bP5NxyVcWh0EJ0eKp5y90426xA+HRZpKET4sNNjrtoYdmD aPX67RLz6D97sJNa0ibYyvr+xEMacAFVTVD0w+MQ= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id B6A643856969 for ; Wed, 19 Apr 2023 12:14:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B6A643856969 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id ADFEA219A0 for ; Wed, 19 Apr 2023 12:14:37 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 945802C141 for ; Wed, 19 Apr 2023 12:14:37 +0000 (UTC) Date: Wed, 19 Apr 2023 12:14:37 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH 4/4] Remove special-cased edges when solving copies User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , X-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" Message-Id: <20230419121619.C45363857038@sourceware.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763606902914580172?= X-GMAIL-MSGID: =?utf-8?q?1763606902914580172?= The following makes sure to remove the copy edges we ignore or need to special-case only once. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-ssa-structalias.cc (solve_graph): Remove self-copy edges, remove edges from escaped after special-casing them. --- gcc/tree-ssa-structalias.cc | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/gcc/tree-ssa-structalias.cc b/gcc/tree-ssa-structalias.cc index 4f350bfbfc0..39c342fae41 100644 --- a/gcc/tree-ssa-structalias.cc +++ b/gcc/tree-ssa-structalias.cc @@ -2873,19 +2873,22 @@ solve_graph (constraint_graph_t graph) } /* Don't try to propagate to ourselves. */ if (to == i) - continue; - - bitmap tmp = get_varinfo (to)->solution; - bool flag = false; - - /* If we propagate from ESCAPED use ESCAPED as - placeholder. */ + { + to_remove = j; + continue; + } + /* Early node unification can lead to edges from + escaped - remove them. */ if (i == eff_escaped_id) - flag = bitmap_set_bit (tmp, escaped_id); - else - flag = bitmap_ior_into (tmp, pts); + { + to_remove = j; + if (bitmap_set_bit (get_varinfo (to)->solution, + escaped_id)) + bitmap_set_bit (changed, to); + continue; + } - if (flag) + if (bitmap_ior_into (get_varinfo (to)->solution, pts)) bitmap_set_bit (changed, to); } if (to_remove != ~0U)