From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id B00D43945053 for ; Wed, 25 Nov 2020 14:30:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B00D43945053 Received: by mail-ej1-x62e.google.com with SMTP id i19so3261889ejx.9 for ; Wed, 25 Nov 2020 06:30:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gSPC1fYSq95i4cAKNqtbEOQ4hgOoQ9g1ecsGJcXfOxM=; b=II0onTvtUc19CqW6xRxWnI+qWponSNhN8D2k8dNEIpPFj2PFbr3e6sL0P/N2X9TCG7 Vz3toPE4tXQhf8MjK6HlMxVA0f8BeI2OMu5+uO4NQC6daepSn/wRkOZxG/Jtn+40JPPQ 2HfZojwEt3+fO3fhglEZiWW4YqMcI4baq8OmCPP9O/Lja1XysmBzL5TcBipG9u4V2NDE cnV+A/OSK7Pk2EWDv2qMECayQcakc3ArA6NliDL2ryuICViosAfLAORkqdlGmPUvtQgD kY3Ks+OHbbhAV9cghqA6kXiP7PZBVgzkivj52W1sA26sz4eDPlZdz+70z/gorrO55f9g aWYA== X-Gm-Message-State: AOAM5307Om6nu4wWKK6hhFW2/DtlUBpmDelxKH7mPT4cSV4HkVwtMd54 zgaZVdRSSj2cbOcM8Ra4Zfo0KhYjV0PfpGc2NK0= X-Google-Smtp-Source: ABdhPJzpgFhTe4oRiU419yo0j4wKvQXOMSLUAHSVFFuUxBUCTTiFoSaVk2zrmhf9QinjL/Jg0uNf5H6RYk2tQ7GvWIM= X-Received: by 2002:a17:906:3617:: with SMTP id q23mr3369957ejb.371.1606314625394; Wed, 25 Nov 2020 06:30:25 -0800 (PST) MIME-Version: 1.0 References: <20201125141320.GB41776@kam.mff.cuni.cz> In-Reply-To: <20201125141320.GB41776@kam.mff.cuni.cz> From: Richard Biener Date: Wed, 25 Nov 2020 15:30:14 +0100 Message-ID: Subject: Re: Handle EAF_DIRECT and EAF_UNUSED of pure calls To: Jan Hubicka Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 25 Nov 2020 14:30:30 -0000 On Wed, Nov 25, 2020 at 3:14 PM Jan Hubicka wrote: > > Hi, > while looking into structalias I noticed that we ignore EAF flags here. > This is pity since we still can apply direct and unused. > This patch simply copies logic from normal call handling. I relaize that > it is bit more expensive by creating callarg and doing transitive > closure there instead of doing one common transitive closure on call use. > I can also scan first if there are both direct and !direct argument and > do this optimization, but it does not seem to affect build times (tested > on spec2k6 gcc LTO build) > > lto-boostrapped/regtested x86_64-linux. OK. Richard. > Honza > > diff --git a/gcc/tree-ssa-structalias.c b/gcc/tree-ssa-structalias.c > index a4832b75436..5f84f7d467f 100644 > --- a/gcc/tree-ssa-structalias.c > +++ b/gcc/tree-ssa-structalias.c > @@ -4253,12 +4253,20 @@ handle_pure_call (gcall *stmt, vec *results) > for (i = 0; i < gimple_call_num_args (stmt); ++i) > { > tree arg = gimple_call_arg (stmt, i); > + int flags = gimple_call_arg_flags (stmt, i); > + > + if (flags & EAF_UNUSED) > + continue; > + > if (!uses) > - { > - uses = get_call_use_vi (stmt); > - make_any_offset_constraints (uses); > - make_transitive_closure_constraints (uses); > - } > + uses = get_call_use_vi (stmt); > + varinfo_t tem = new_var_info (NULL_TREE, "callarg", true); > + tem->is_reg_var = true; > + make_constraint_to (tem->id, arg); > + make_any_offset_constraints (tem); > + if (!(flags & EAF_DIRECT)) > + make_transitive_closure_constraints (tem); > + make_copy_constraint (uses, tem->id); > make_constraint_to (uses->id, arg); > } >