Always emit kernel arg info for SPIR.
http://llvm.org/bugs/show_bug.cgi?id=21555 Currently, kernel argument metadata is omitted unless the "-cl-kernel-arg-info" option is specified. But the SPIR 1.2 spec requires that all metadata except kernel_arg_name should always be emitted, and kernel_arg_name is only emitted when "-cl-kernel-arg-info" is specified. Patch ported by Ryan Burn from the Khronos SPIR generator. https://github.com/KhronosGroup/SPIR llvm-svn: 223340
This commit is contained in:
@@ -483,7 +483,8 @@ static void GenOpenCLArgMetadata(const FunctionDecl *FD, llvm::Function *Fn,
|
||||
kernelMDArgs.push_back(llvm::MDNode::get(Context, argTypeNames));
|
||||
kernelMDArgs.push_back(llvm::MDNode::get(Context, argBaseTypeNames));
|
||||
kernelMDArgs.push_back(llvm::MDNode::get(Context, argTypeQuals));
|
||||
kernelMDArgs.push_back(llvm::MDNode::get(Context, argNames));
|
||||
if (CGM.getCodeGenOpts().EmitOpenCLArgMetadata)
|
||||
kernelMDArgs.push_back(llvm::MDNode::get(Context, argNames));
|
||||
}
|
||||
|
||||
void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
|
||||
@@ -497,9 +498,8 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
|
||||
SmallVector <llvm::Value*, 5> kernelMDArgs;
|
||||
kernelMDArgs.push_back(Fn);
|
||||
|
||||
if (CGM.getCodeGenOpts().EmitOpenCLArgMetadata)
|
||||
GenOpenCLArgMetadata(FD, Fn, CGM, Context, kernelMDArgs,
|
||||
Builder, getContext());
|
||||
GenOpenCLArgMetadata(FD, Fn, CGM, Context, kernelMDArgs, Builder,
|
||||
getContext());
|
||||
|
||||
if (const VecTypeHintAttr *A = FD->getAttr<VecTypeHintAttr>()) {
|
||||
QualType hintQTy = A->getTypeHint();
|
||||
|
||||
Reference in New Issue
Block a user