From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 33049 invoked by alias); 27 May 2019 13:55:03 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 33040 invoked by uid 89); 27 May 2019 13:55:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:797, UD:tree-ssa-alias.c, 271599 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 May 2019 13:55:01 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 3AF0628003A; Mon, 27 May 2019 15:54:58 +0200 (CEST) Date: Mon, 27 May 2019 13:57:00 -0000 From: Jan Hubicka To: Richard Biener Cc: gcc-patches@gcc.gnu.org, d@dcepelik.cz Subject: Re: Teach same_types_for_tbaa to structurally compare arrays, pointers and vectors Message-ID: <20190527135458.imf4ek2kd7qwefxy@kam.mff.cuni.cz> References: <20190524111433.mv5z33ysiatlxmxz@kam.mff.cuni.cz> <20190524131856.zduvz27dbjfy6yqw@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2019-05/txt/msg01777.txt.bz2 Hi, this is minimal version of patch adding just the pointer compare. Bootstrapped/regtested x86_64-linux, makes sense? :) Honza * tree-ssa-alias.c (same_type_for_tbaa): Return 1 if types same as pointers. Index: tree-ssa-alias.c =================================================================== --- tree-ssa-alias.c (revision 271599) +++ tree-ssa-alias.c (working copy) @@ -787,6 +787,10 @@ same_type_for_tbaa (tree type1, tree typ type1 = TYPE_MAIN_VARIANT (type1); type2 = TYPE_MAIN_VARIANT (type2); + /* Handle common case. */ + if (type1 == type2) + return 1; + /* If we would have to do structural comparison bail out. */ if (TYPE_STRUCTURAL_EQUALITY_P (type1) || TYPE_STRUCTURAL_EQUALITY_P (type2))