From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oo1-xc2f.google.com (mail-oo1-xc2f.google.com [IPv6:2607:f8b0:4864:20::c2f]) by sourceware.org (Postfix) with ESMTPS id 8B7543858D28 for ; Sun, 3 Mar 2024 23:58:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8B7543858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8B7543858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::c2f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709510341; cv=none; b=L8/YqoAOi5U8DbV5zVvDnEkRQ/W8ZCZpLJkDdMtg+WAeOblXcpsQo4cytCUmECVMd8JljVHbg8INZdnGGtoYLEQKZZ4n6sF1oucWL/a0ca7BaGr8GU0n4v6uPon+MXF8bD8pxudWzo0yD5gpxki+rmQ0csYZuyaVZSKVPyXaIHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709510341; c=relaxed/simple; bh=lPkWjHh2xw7WWNT9zN8/ubHAKlY/U6X+wiygKHux91w=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=jMGgS6b77J9cGmca6faSnksi1xXFPtuibgG99m61cVYTYJY2tUjYCnKt6RvvSjvlzugCBCG06iAdMivAZ+JSGvEjHiNLySl9RHpmuu4o0C890gRoSgpjKdcCQ440dddcl8Q8AHXTXQWt2dQue2KnfQzyT8EZ2OhSe+Jq4djgK1A= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-oo1-xc2f.google.com with SMTP id 006d021491bc7-5a132ba9ff2so334085eaf.3 for ; Sun, 03 Mar 2024 15:58:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709510337; x=1710115137; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=pfKnwA1qeVLwhqbHX59AS1nDY8Z/VIYiH3Kud/syil8=; b=joJDPiGxBW9Bog+7nAIkbDp27HHf0lQzowob5KUddDoIMx4rC+bFnLfBwsObW2ZxX/ LVm3KFdYmKOrX2nXumXHHMw+B45Du9bOE/4zbYg1FzfgDQeFN7GSAXQDaztDkx+5xzlj WMR0FXXn8uWFMR9DecP0ZLuWye5UY9GYeZsKunv5nyrnfF5TBMkuttaYam9CWaZAILAW oo6g7I6iOUkfqY67ZdHMgbqgJo5yFH9KABS+KabUK7KUcJu5PbWA8vL/KkrBX8JWmh8X /0av5t0czI/YJw1XdRDqY00bIbJtmS9btmtJhLiJSWxqnydEOMSUy22+TWuZTk7JwYin DoLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709510337; x=1710115137; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=pfKnwA1qeVLwhqbHX59AS1nDY8Z/VIYiH3Kud/syil8=; b=qii50HhNH6+YskiqCO79P7CB9PA22ilqkkQeYb3vfvGChtuYpP8XRJcpUyOyS7Y2X8 G1gJLoX5Se+kWbyABHXwgc9jDhzp+HcOfKl+x6jQJb7XBM2kifGAxIjzN78g27V0nxCP 8UFMGLoOPL+YcQSxbVk6Tvuqm+ykGgDPzb+p5p/Pf7CWcJ5F06WpAWtdV/fXsWQ14Dpm Q3TH5n3Vzl3JQUwn+ueDmgParfBT+ajGHay93lhpFMkFhpD2U2qb5+RqHxz0tLTGJ9Qq H2ZjCdo4KSIYX4MKC1j0DDpm6JUlB3o9FIzpxaA4VWrGS1sT7mQw5YD5ol+6jcXt5wyn B10Q== X-Forwarded-Encrypted: i=1; AJvYcCV/KeUF6glrBp591DA5HCRyDPtMY8E4HXTcMhtxblKZ60tGS29Hol9hnzPu6SiSaSxAQg7JjMEk1rP8LpKBHpvrKEdwp8RUog== X-Gm-Message-State: AOJu0YzSZ6DnbN0OmMqZrTxZSrwRfCvfoFVbwB1rPNHoxn5uDpcO+E41 QTyJ7rNZvygV51SOvjTVWSuuqLlLb/RArIQ8lgobIwm+JdNju3tg X-Google-Smtp-Source: AGHT+IFg71Eru/AICadOkmGK8FheCkO2e0R52jjt3+YJkrOM66GBPOje8RgCRM6QOiTBPiUiak0c5w== X-Received: by 2002:a05:6820:208a:b0:5a1:3d7e:add8 with SMTP id bz10-20020a056820208a00b005a13d7eadd8mr307872oob.2.1709510337433; Sun, 03 Mar 2024 15:58:57 -0800 (PST) Received: from [172.31.0.109] ([136.36.72.243]) by smtp.gmail.com with ESMTPSA id by18-20020a056820201200b0059a096ee494sm354909oob.47.2024.03.03.15.58.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 03 Mar 2024 15:58:56 -0800 (PST) Message-ID: <5f80b3aa-6add-4b64-89f3-75001d92d8b6@gmail.com> Date: Sun, 3 Mar 2024 16:58:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH] rtl-optimization/113597 - recover base term for argument pointers Content-Language: en-US To: Richard Biener , gcc-patches@gcc.gnu.org References: <65c5fdce.5d0a0220.b4fa7.11a6SMTPIN_ADDED_MISSING@mx.google.com> From: Jeff Law In-Reply-To: <65c5fdce.5d0a0220.b4fa7.11a6SMTPIN_ADDED_MISSING@mx.google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 List-Id: On 2/9/24 03:26, Richard Biener wrote: > The following allows a base term to be derived from an existing > MEM_EXPR, notably the points-to set of a MEM_REF base. For the > testcase in the PR this helps RTL DSE elide stores to a stack > temporary. This covers pointers to NONLOCAL which can be mapped > to arg_base_value, helping to disambiguate against other special > bases (ADDRESS) as well as PARM_DECL accesses. I like it and as you note later, it's extendable. > > Bootstrapped and tested on x86_64-unknown-linux-gnu. > > This is an attempt to recover some of the losses from dumbing down > find_base_{term,value}. I did give my ideas how to properly do > this during stage1 a start, I will post a short incomplete RFC series > later today. I saw those, but set them aside for gcc-15. > > OK for trunk? > > I've included all languages in testing and also tested with -m32 but > details of RTL alias analysis might escape me ... > > Thanks, > Richard. > > PR rtl-optimization/113597 > * alias.cc (find_base_term): Add argument for the whole mem > and derive a base term from its MEM_EXPR. > (true_dependence_1): Pass down the MEMs to find_base_term. > (write_dependence_p): Likewise. > (may_alias_p): Likewise. I'd lean ever so slightly against including this. Not because I see anything wrong, more so because we don't have a lot of time for this to shake out if there are any problems. But I wouldn't go as far as to say I object to including it. So OK for the trunk if you want to go forward now. Or defer if you want to take the somewhat safer route of waiting to gcc-15 to tackle this. jeff