================ @@ -6138,6 +6150,17 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, CodeGenFunction(*this).GenerateCode(GD, Fn, FI); setNonAliasAttributes(GD, Fn); + + if (D->hasAttr<OpenCLKernelAttr>()) { + if (GD.getKernelReferenceKind() == KernelReferenceKind::Stub) { + if (Fn->hasFnAttribute(llvm::Attribute::NoInline)) + Fn->removeFnAttr(llvm::Attribute::NoInline); + if (Fn->hasFnAttribute(llvm::Attribute::InlineHint)) + Fn->removeFnAttr(llvm::Attribute::InlineHint); + Fn->addFnAttr(llvm::Attribute::AlwaysInline); + } + } ---------------- lalaniket8 wrote:
I see, yes it seems that adding the alwaysinline attribute is not necessary. I have removed it in the latest commit and made required changes in the test files. https://github.com/llvm/llvm-project/pull/115821 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits