This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: How to detect whether we're inside of a loop??
> Date: Wed, 9 Apr 2003 16:56:55 -0400 (EDT)
> From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
> I think your approach would be suited for finding which of the if-else
> branches to choose. Finding the looping spots is what I'm looking
> for because I think it has more impact.
>
> Do you agree with this line of reasoning?
No, not really. For instance, a little-known fact is that the average
number of iterations for a loop is about 1.5; someone did some
analysis on some huge collection of programs and this is the number
they came up with. So it's important to know *which* loops to look
at.
--
- Geoffrey Keating <geoffk at geoffk dot org>