https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88626

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
> Maybe a heuristic that gives a "bonus" for inlining a function that contains
> __builtin_constant_p (only if the argument looks like it depends on the
> function parameters?) would be easier? I don't know if we have something like
> that yet.

Yes, we have inline bonuses (called inline_hint) and I guess adding
bonus for builtin_constant_p calls which depends on function parameter
should be doable and indeed makes sense to me.

Still for serious builtin_constant_p performance I think we need to do
something about the double accounting problem I explained above that is
bit harder to fix (the time/size vector themselves do not have any
if-then-else semantics and predicates have no NOT operation, but merging
the outcomes is possible, just bit hard to implement)

Honza

Reply via email to