From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22636 invoked by alias); 17 Jan 2004 08:00:15 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 22614 invoked from network); 17 Jan 2004 08:00:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 17 Jan 2004 08:00:12 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id i0H809l01141; Sat, 17 Jan 2004 03:00:09 -0500 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i0H809g26539; Sat, 17 Jan 2004 03:00:09 -0500 Received: from dnovillo.cipe.redhat.com (dnovillo.cipe.redhat.com [10.0.0.106]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i0H807Xd001081; Sat, 17 Jan 2004 03:00:08 -0500 Subject: Re: [RFC] Contributing tree-ssa to mainline From: Diego Novillo To: Per Bothner Cc: "gcc@gcc.gnu.org" In-Reply-To: <4008CD99.6080501@bothner.com> References: <10401170324.AA15949@vlsi1.ultra.nyu.edu> <1074309907.3147.139.camel@frodo.toronto.redhat.com> <4008CD99.6080501@bothner.com> Content-Type: multipart/mixed; boundary="=-UehBa2U7mhTHatn71UQg" Organization: Red Hat Canada Message-Id: <1074326403.5368.33.camel@frodo.toronto.redhat.com> Mime-Version: 1.0 Date: Sat, 17 Jan 2004 08:00:00 -0000 X-SW-Source: 2004-01/txt/msg01035.txt.bz2 --=-UehBa2U7mhTHatn71UQg Content-Type: text/plain Content-Transfer-Encoding: 7bit Content-length: 935 On Sat, 2004-01-17 at 00:52, Per Bothner wrote: > Diego Novillo wrote: > > > On Fri, 2004-01-16 at 22:24, Richard Kenner wrote: > > > > > >>Remember that the last time we had the discussion of the timing of tree-ssa, > >>people claimed it was "essential" for 3.5 since there was a tremendous > >>improvement on some C++ cases. So let's see those cases. > >> > > > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12747 > > Can you give numbers? I.e. how much faster does that (or a similar) > testcase run? > Sure. I added some of the missing bits in 12747's test program to make it executable (attached). The binary produced by mainline executes in 28.62 seconds. The one produced by tree-ssa executes in 10.57 seconds (average over 3 runs). As with any benchmark, the fact that we do good here cannot be extrapolated to any other random piece of code. [ apologies to our C++ experts for butchering the test case. ] Diego. --=-UehBa2U7mhTHatn71UQg Content-Disposition: attachment; filename=12747.C Content-Type: text/x-c++; name=12747.C; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-length: 2039 #include #include class BitRef; class BitVector { public: BitVector (unsigned nbits) : m_size(nbits) { m_data = (unsigned long *)malloc (m_size*sizeof(unsigned long)); } BitVector (const BitVector &orig) : m_size (orig.size()) { m_data = (unsigned long *)malloc (m_size*sizeof(unsigned long)); memcpy(m_data,orig.m_data,m_size); } BitVector & operator= (const BitVector &orig) { m_size = orig.size(); m_data = (unsigned long *)malloc (m_size*sizeof(unsigned long)); memcpy(m_data,orig.m_data,m_size); } ~BitVector () { free (m_data); } unsigned size () const { return m_size; } bool getBit (unsigned idx) { return m_data[idx] != 0; } void setBit (unsigned idx, bool value) { m_data[idx] = (unsigned long)value; } inline BitRef operator[] (unsigned idx); //private: unsigned long *m_data; unsigned m_size; }; class BitRef { public: BitRef (BitVector & bv, unsigned idx):m_bv (bv), m_idx (idx) { } bool value () const { return m_bv.getBit (m_idx); } operator bool () const { return value (); } BitRef & operator= (bool newVal) { m_bv.setBit (m_idx, newVal); return *this; } BitRef & operator= (const BitRef & newVal) { m_bv.setBit (m_idx, newVal.value ()); return *this; } private: BitVector & m_bv; unsigned m_idx; }; inline BitRef BitVector::operator[] (unsigned idx) { return BitRef (*this, idx); } // abstract copy: compiler should be able to make this as fast as copy_2 void copy (BitVector & dest, BitVector & src) { unsigned sz = dest.size (); for (unsigned i = 0; i < sz; i++) dest[i] = src[i]; } // direct copy, without proxy objects. void copy_2 (BitVector & dest, BitVector & src) { unsigned sz = dest.size (); for (unsigned i = 0; i < sz; i++) dest.setBit (i, src.getBit (i)); } main() { BitVector bv1(30000), bv2(30000); int i; for (i = 0; i < 50000; i++) copy (bv1, bv2); } --=-UehBa2U7mhTHatn71UQg--