-----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-----