From patchwork Fri Aug 23 10:44:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1152116 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-507583-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="C6+LgIat"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46FJ2B19R0z9s3Z for ; Fri, 23 Aug 2019 20:45:05 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=u7bBnNcJWnhF/pR+BxrzI+zh7WxIetqpS0VRVKTnbyS8iPNae/Vyz /D0RgeM77eRNm8GRxzBiQk2b3pBxjukrrPhKJDvSMNj/iGAM5zoHsziztzMCG75E K9Qv76TS8Bi3d51f28Yjj5Oh/O226oxy09ulMHyQX9o3FjdXviNV8E= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=wQZQMIG5BkYgVKg9Ek1IQVNv+mM=; b=C6+LgIatCIFVoBY5OfnI UDZA/iQeDqI9Te+Vople0CMFBW0/l+Nvj582o/9GFVAkyC/9or84PnW91JnbGsf6 1Rrzkw6oM/SEm22A7v8lLko5uT5acDPTVNocx9fpd5sU40JhEgfRj2onyIqXJ8ss Ir9iJHnnkcyLQDgr1lr0WFU= Received: (qmail 34399 invoked by alias); 23 Aug 2019 10:44:59 -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 34382 invoked by uid 89); 23 Aug 2019 10:44:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1799, anyways X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 23 Aug 2019 10:44:58 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id CF58AABD6 for ; Fri, 23 Aug 2019 10:44:55 +0000 (UTC) Date: Fri, 23 Aug 2019 12:44:55 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Schedule another update_address_taken late Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 As can be seen on the testcase in PR91526 the vectorizer can end up marking things addressable because it creates very many pointer IV. Then unrolling can completely elide a loop or IVOPTs can choose other IVs. Thus it's certainly beneficial for other passes to have an updated TREE_ADDRESSABLE, esp. NRV which bails out on TREE_ADDRESSABLE marked vars. Similar tail-call wants to know this. Not enough to fix the PR, but anyways. Bootstrap / regtest running on x86_64-unknown-linux-gnu. Richard. 2019-08-23 Richard Biener PR tree-optimization/91526 * passes.def: Note that after late FRE we do TODO_update_address_taken. * tree-ssa-sccvn.c (pass_fre::execute): In late mode schedule TODO_update_address_taken. Index: gcc/passes.def =================================================================== --- gcc/passes.def (revision 274843) +++ gcc/passes.def (working copy) @@ -313,6 +313,8 @@ along with GCC; see the file COPYING3. NEXT_PASS (pass_split_paths); NEXT_PASS (pass_tracer); NEXT_PASS (pass_fre, false /* may_iterate */); + /* After late FRE we rewrite no longer addressed locals into SSA + form if possible. */ NEXT_PASS (pass_thread_jumps); NEXT_PASS (pass_dominator, false /* may_peel_loop_headers_p */); NEXT_PASS (pass_strlen); Index: gcc/tree-ssa-sccvn.c =================================================================== --- gcc/tree-ssa-sccvn.c (revision 274843) +++ gcc/tree-ssa-sccvn.c (working copy) @@ -7312,6 +7415,11 @@ pass_fre::execute (function *fun) if (iterate_p) loop_optimizer_finalize (); + /* For late FRE after IVOPTs and unrolling, see if we can + remove some TREE_ADDRESSABLE and rewrite stuff into SSA. */ + if (!may_iterate) + todo |= TODO_update_address_taken; + return todo; }