From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A299A385840C; Mon, 22 Nov 2021 23:07:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A299A385840C From: "hubicka at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/103168] Value numbering for PRE of pure functions can be improved Date: Mon, 22 Nov 2021 23:07:50 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: hubicka at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2021 23:07:50 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D103168 --- Comment #13 from Jan Hubicka --- Concerning comment #10, the problem was that the loop walking all accesses = was missing loads->every_base check. This is used to represent that we track no useful info about loads performed at all. Anyway if I read the code correctly, it does nothing useful if the access t= ree contains any access for which we can not construct ref and thus one can sim= ply check global_memory_access and do not care about every_base/every_ref/every_access since these must be all false. I simplified the walk a bit and added code pre-computing number of accesses= in the tree into the summary. What we can also do is, when hitting access for which we can not construct = ref, or when hitting every_ref/every_acccess, is to construct ref with base_alias_set/ref_alias_set as given by the access tree but with base=3DNU= LL, offset=3D0 and size=3Dmax_size=3D-1. This should still let the basic TBAA o= racle to disambiguate.=