This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Predict recursive calls as unlikely
- From: Andi Kleen <andi at firstfloor dot org>
- To: Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sat, 25 Jun 2016 10:02:54 -0700
- Subject: Re: Predict recursive calls as unlikely
- Authentication-results: sourceware.org; auth=none
- References: <20160625120350 dot GA8957 at kam dot mff dot cuni dot cz>
Jan Hubicka <hubicka@ucw.cz> writes:
> Hi,
> this is first of two patches for getting more realistic predictions of
> recursive functions. It is clear that in order for recursion to finish, the
> sum of frequencies of recursive calls should not exceed sum of frequencies of
> the function entry block. This global condition is however bit hard to achieve
> by local predictors.
How would this handle tail recursion?
In this case it may just be a funky way to write a loop, but not
predicting it as taken would be bad.
-Andi