This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix size_estimation for builtin_expect


ping.

On Fri, Sep 27, 2013 at 3:56 PM, Rong Xu <xur@google.com> wrote:
> Hi,
>
> 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
>   https://mail.google.com/mail/u/0/?pli=1#label/gcc-paches/1415c590ad8c5315
>
> 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.
>
> Thanks,
>
> -Rong


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]