From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29469 invoked by alias); 17 Aug 2011 19:26:14 -0000 Received: (qmail 29460 invoked by uid 22791); 17 Aug 2011 19:26:13 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_FC X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 17 Aug 2011 19:25:54 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7HJPsaX022343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Aug 2011 15:25:54 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7HJPrJu013207; Wed, 17 Aug 2011 15:25:53 -0400 Received: from [10.3.113.132] (ovpn-113-132.phx2.redhat.com [10.3.113.132]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p7HJPpJK021152; Wed, 17 Aug 2011 15:25:52 -0400 Message-ID: <4E4C15BF.10403@redhat.com> Date: Wed, 17 Aug 2011 22:50:00 -0000 From: Jeff Law User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20110707 Thunderbird/5.0 MIME-Version: 1.0 To: Richard Guenther CC: gcc-patches Subject: Re: RFA: Avoiding unprofitable speculation References: <4E4ADDAC.4090006@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2011-08/txt/msg01429.txt.bz2 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 08/17/11 01:21, Richard Guenther wrote: > > We don't have a way to distinguish branch-taken vs. branch-not-take > costs, right? Not that I'm aware of. However, BRANCH_COST does allow the backend to change the cost of a branch based on its predictability. > I would expect that for non-pipelined archs the branch does have the > same cost all the time, so ifcvt would be correct, no? The branch we're able to eliminate is typically (always?) an unconditional branch. The unconditional branch we eliminate is only executed some percentage of the time based on the conditional branch that remains in the stream. So regardless of the underlying cost of the branch we eliminate, we still want to compare the cost of the speculated insns against the scaled cost of the branch we're able to eliminate. > Do you happen to know how valgrind counts branches here? I don't know all the low level details -- I'd have to sit down with the annotation code in the cachegrind plugin. Presumably since valgrind also attempts to model branch prediction it carries a number of counters associated with each branch which get bumped as needed by the instrumented code. Jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOTBW/AAoJEBRtltQi2kC70kIH/183zcbFr5NiHbM7JO9xkGoL lxiwEKsWW3m5x/PYRb+S82prPjRI/2ZzcnDE+ZzjffF+W2agOCdE29DvFjm8JkdI bUwAMPUrxip5y9iZSwreywtbm73yw/9GTkkr+oHYZupqTUbbC3rw3kV5f/DJq/xP jmzFPeK1U1Glmus9mWruiSwRloyh2o5usysdnB7aRhO/KdH1jWG7EfZ7cvfQhSWf u8IYkxRsdQD/xd+6TpxOgmRj8kjJlYw0oAMjNsGkiNnNqyqzZBjOe6sHE59IWc27 Z35HrpRvXevuImE6XQF6KmBWiK1cjExVdmlnZMTuOdy/tXklmp0zLP1EAbP5Sd8= =o4mr -----END PGP SIGNATURE-----