From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26028 invoked by alias); 18 Jun 2014 08:46:21 -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 26012 invoked by uid 89); 18 Jun 2014 08:46:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 18 Jun 2014 08:46:17 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F4A9AC0C; Wed, 18 Jun 2014 08:46:14 +0000 (UTC) Message-ID: <53A151D5.9020005@suse.cz> Date: Wed, 18 Jun 2014 08:46:00 -0000 From: =?windows-1252?Q?Martin_Li=9Aka?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: Paolo Carlini CC: gcc-patches@gcc.gnu.org, hubicka@ucw.cz Subject: Re: [PATCH 1/5] New Identical Code Folding IPA pass References: <53A0A085.9020008@oracle.com> In-Reply-To: <53A0A085.9020008@oracle.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg01434.txt.bz2 On 06/17/2014 10:09 PM, Paolo Carlini wrote: > Hi, > > On 13/06/14 12:24, mliska wrote: >> The optimization is inspired by Microsoft /OPT:ICF optimization (http://msdn.microsoft.com/en-us/library/bxwfs976.aspx) that merges COMDAT sections with each function reside in a separate section. > In terms of C++ testcases, I'm wondering if you already double checked that the new pass already does well on the typical examples on which, I was told, the Microsoft optimization is known to do well, eg, code instantiating std::vector for different pointer types, or even long and long long on x86_64-linux, things like that. I've just added another C++ test case: #include using namespace std; static vector *> a; static vector b; int main() { return b.size() + a.size (); } where the pass identifies following equality: Semantic equality hit:std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::vector*; _Alloc = std::allocator*>; std::vector<_Tp, _Alloc>::size_type = long unsigned int]->std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = void*; _Alloc = std::allocator; std::vector<_Tp, _Alloc>::size_type = long unsigned int] Semantic equality hit:static void std::_Destroy_aux::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = void**]->static void std::_Destroy_aux::__destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::vector**] Semantic equality hit:void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = void**]->void std::_Destroy(_ForwardIterator, _ForwardIterator) [with _ForwardIterator = std::vector**] Semantic equality hit:void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = void**; _Tp = void*]->void std::_Destroy(_ForwardIterator, _ForwardIterator, std::allocator<_T2>&) [with _ForwardIterator = std::vector**; _Tp = std::vector*] Semantic equality hit:void __gnu_cxx::new_allocator<_Tp>::deallocate(__gnu_cxx::new_allocator<_Tp>::pointer, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = void*; __gnu_cxx::new_allocator<_Tp>::pointer = void**; __gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int]->void __gnu_cxx::new_allocator<_Tp>::deallocate(__gnu_cxx::new_allocator<_Tp>::pointer, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = std::vector*; __gnu_cxx::new_allocator<_Tp>::pointer = std::vector**; __gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int] Semantic equality hit:static void __gnu_cxx::__alloc_traits<_Alloc>::deallocate(_Alloc&, __gnu_cxx::__alloc_traits<_Alloc>::pointer, __gnu_cxx::__alloc_traits<_Alloc>::size_type) [with _Alloc = std::allocator; __gnu_cxx::__alloc_traits<_Alloc>::pointer = void**; __gnu_cxx::__alloc_traits<_Alloc>::size_type = long unsigned int]->static void __gnu_cxx::__alloc_traits<_Alloc>::deallocate(_Alloc&, __gnu_cxx::__alloc_traits<_Alloc>::pointer, __gnu_cxx::__alloc_traits<_Alloc>::size_type) [with _Alloc = std::allocator*>; __gnu_cxx::__alloc_traits<_Alloc>::pointer = std::vector**; __gnu_cxx::__alloc_traits<_Alloc>::size_type = long unsigned int] As one would expect, there is a function 'size'. Martin > > Thanks, > Paolo.