This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] fix size_estimation for builtin_expect
- From: Rong Xu <xur at google dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, Richard Biener <richard dot guenther at gmail dot com>, David Li <davidxl at google dot com>
- Date: Tue, 1 Oct 2013 10:08:18 -0700
- Subject: Re: [PATCH] fix size_estimation for builtin_expect
- Authentication-results: sourceware.org; auth=none
- References: <CAF1bQ=QB1-a6AFriiOj3dSk0=0vY+Q0UBX7Q6F6CyuiT9q-=Tg at mail dot gmail dot com>
On Fri, Sep 27, 2013 at 3:56 PM, Rong Xu <firstname.lastname@example.org> wrote:
> builtin_expect should be a NOP in size_estimation. Indeed, the call
> stmt itself is 0 weight in size and time. But it may introduce
> an extra relation expr which has non-zero size/time. The end result
> is: for w/ and w/o builtin_expect, we have different size/time estimation
> for inlining.
> This patch fixes this problem.
> An earlier discussion of this patch is
> This new patch address Honza's comments.
> It passes the bootstrap and regression.
> Richard: I looked at your tree-ssa.c:walk_use_def_chains() code. I think
> that's an overkill for this simple problem. Your code is mostly dealing
> with the recursively walk the PHI node to find the real def stmts.
> Here the traversal is within one BB and I may need to continue on multiple
> real assignment. Calling walk_use_def_chains probably only uses
> the SSA_NAME_DEF_STMT() part of the code.