r253117 - Clarify and elaborate the conditions on which we're checking target

Robinson, Paul via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 16 16:20:32 PST 2015


Much better, thanks!
--paulr

> -----Original Message-----
> From: cfe-commits [mailto:cfe-commits-bounces at lists.llvm.org] On Behalf Of
> Eric Christopher via cfe-commits
> Sent: Friday, November 13, 2015 5:56 PM
> To: cfe-commits at lists.llvm.org
> Subject: r253117 - Clarify and elaborate the conditions on which we're
> checking target
> 
> Author: echristo
> Date: Fri Nov 13 19:56:04 2015
> New Revision: 253117
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=253117&view=rev
> Log:
> Clarify and elaborate the conditions on which we're checking target
> features for calls.
> 
> Modified:
>     cfe/trunk/lib/CodeGen/CGExpr.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
> URL: http://llvm.org/viewvc/llvm-
> project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=253117&r1=253116&r2=253117&vi
> ew=diff
> ==========================================================================
> ====
> --- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Nov 13 19:56:04 2015
> @@ -3748,10 +3748,12 @@ RValue CodeGenFunction::EmitCall(QualTyp
>           "Call must have function pointer type!");
> 
>    if (const FunctionDecl *FD =
> dyn_cast_or_null<FunctionDecl>(TargetDecl))
> -    // If this isn't an always_inline function we can't guarantee that
> any
> -    // function isn't being used correctly so only check if we have the
> -    // attribute and a set of target attributes that might be different
> from
> -    // our default.
> +    // We can only guarantee that a function is called from the correct
> +    // context/function based on the appropriate target attributes,
> +    // so only check in the case where we have both always_inline and
> target
> +    // since otherwise we could be making a conditional call after a
> check for
> +    // the proper cpu features (and it won't cause code generation issues
> due to
> +    // function based code generation).
>      if (TargetDecl->hasAttr<AlwaysInlineAttr>() &&
>          TargetDecl->hasAttr<TargetAttr>())
>        checkTargetFeatures(E, FD);
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


More information about the llvm-commits mailing list