On Wed, Feb 6, 2013 at 9:07 AM, Jordan Rose <[email protected]> wrote:

>
>
> ================
> Comment at: include/clang/Basic/CharInfo.h:29
> @@ +28,3 @@
> +/// Returns true if this is an ASCII character.
> +LLVM_ATTRIBUTE_ALWAYS_INLINE
> +static inline bool isASCII(char c) {
> ----------------
> Richard Smith wrote:
> > Do these attributes make a measurable difference? 'static inline' is
> already a pretty big hint to inline, especially for a single-call-site
> function.
> I didn't measure it at all; I just figured it wouldn't hurt and would keep
> people from directly accessing InfoTable unless they //really// needed it.
> I can easily take them out again.


Well, it might hurt if we're force-inlining cold functions into hot
functions; this might prevent some important part of the lexer from getting
inlined appropriately. Generally, I think that ALWAYS_INLINE should only be
added if we have some reason to think the inliner would otherwise do the
wrong thing and we would get worse code -- and even in that case, we should
look at whether we can fix the optimizer before adding such a hint.
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to