How to detect whether we're inside of a loop??
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Fri Apr 11 18:28:00 GMT 2003
> From: dewar@gnat.com (Robert Dewar)
>
> > The average you cite above for loops means that the loop-body is still
> > executed more often than code which is not in a loop, just not by as
> > much as I'd hoped. And if-then clauses have execution probability of
> > less than one for each clause so code in there is even less likely to
> > be executed than loop bodies.
>
> Normal assumptions are that inner loops are executed more often than
> outer loops. The figure of 1.5 is wildly wrong for inner loops
Yup, the function I posted here:
http://gcc.gnu.org/ml/gcc/2003-04/msg00392.html
allows you to check how deep your loop nesting is.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc
mailing list