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??
- From: Geoff Keating <geoffk at geoffk dot org>
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: 09 Apr 2003 11:25:07 -0700
- Subject: Re: How to detect whether we're inside of a loop??
- References: <200304082013.QAA17265@caip.rutgers.edu>
"Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu> writes:
> I was interested in experimenting with heuristics which might expand a
> builtin depending on whether at the point of expansion we're in a loop
> or not. E.g. It might make sense to expand something which might
> create slightly larger code only if we think it's likely that it'll be
> executed a number of times. I'm guessing that being inside a loop is
> one way to increase that probability. Thus I was curious if there's a
> way to detect this.
Why don't you just use the support that GCC already has for detecting
the probability that a block will be executed?
--
- Geoffrey Keating <geoffk at geoffk dot org>